Return path including executable instead of without

The previous implementation returned the path the executable was in instead
of returning the path including the executable (i.e. it returned ...bin
instead of ...bin/executable). This is not what the original methods did
and caused the process forking of adb to fail.

This patch corrects the implementation.

(cherry picked from commit 26b53bb75e6bdf9aa7820a3343845dae145625cc)

Change-Id: Icad6870bbb0a88f611ca71d90fff30f7b576c367
diff --git a/adb/get_my_path_darwin.c b/adb/get_my_path_darwin.c
index 9141b57..65dd226 100644
--- a/adb/get_my_path_darwin.c
+++ b/adb/get_my_path_darwin.c
@@ -20,11 +20,11 @@
 void get_my_path(char *s, size_t maxLen)
 {
     CFBundleRef mainBundle = CFBundleGetMainBundle();
-    CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
-    CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
-    CFRelease(bundleURL);
+    CFURLRef executableURL = CFBundleCopyExecutableURL(mainBundle);
+    CFStringRef executablePathString = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
+    CFRelease(executableURL);
 
-    CFStringGetCString(bundlePathString, s, maxLen, kCFStringEncodingASCII);
-    CFRelease(bundlePathString);
+    CFStringGetCString(executablePathString, s, maxLen, kCFStringEncodingASCII);
+    CFRelease(executablePathString);
 }
 
diff --git a/fastboot/util_osx.c b/fastboot/util_osx.c
index e80a8f3..a8f5c31 100644
--- a/fastboot/util_osx.c
+++ b/fastboot/util_osx.c
@@ -32,12 +32,12 @@
 void get_my_path(char s[PATH_MAX])
 {
     CFBundleRef mainBundle = CFBundleGetMainBundle();
-    CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
-    CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
-    CFRelease(bundleURL);
+    CFURLRef executableURL = CFBundleCopyExecutableURL(mainBundle);
+    CFStringRef executablePathString = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
+    CFRelease(executableURL);
 
-    CFStringGetCString(bundlePathString, s, PATH_MAX - 1, kCFStringEncodingASCII);
-    CFRelease(bundlePathString);
+    CFStringGetCString(executablePathString, s, PATH_MAX-1, kCFStringEncodingASCII);
+    CFRelease(executablePathString);
 
 	char *x;
     x = strrchr(s, '/');