Make symlink creation in `tools/buildbot-setup-device.sh` more robust.

Check for existing symlinks before creating them.

Test: Run `art/tools/buildbot-setup-device.sh` twice and check for errors
Bug: 160559664
Change-Id: I777e9677c47e9c1003f1a1e18f9a8d1fd85cc7bc
diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh
index 10f526c..00dc3bc 100755
--- a/tools/buildbot-setup-device.sh
+++ b/tools/buildbot-setup-device.sh
@@ -148,7 +148,8 @@
 
   # Populate /etc in chroot with required files.
   adb shell mkdir -p "$ART_TEST_CHROOT/system/etc"
-  adb shell "cd $ART_TEST_CHROOT && ln -sf system/etc etc"
+  adb shell test -L "$ART_TEST_CHROOT/etc" \
+    || adb shell ln -s system/etc "$ART_TEST_CHROOT/etc"
 
   # Provide /proc in chroot.
   adb shell mkdir -p "$ART_TEST_CHROOT/proc"
@@ -175,5 +176,6 @@
   adb shell mkdir -p "$ART_TEST_CHROOT/linkerconfig"
 
   # Create /bin symlink for shebang compatibility.
-  adb shell ln -s system/bin "$ART_TEST_CHROOT/bin"
+  adb shell test -L "$ART_TEST_CHROOT/bin" \
+    || adb shell ln -s system/bin "$ART_TEST_CHROOT/bin"
 fi