sdcard: Allow building as a static library

 * Split main() out in order to allow linking with a multi-call
   executable such as recovery.

Change-Id: I3325135e47e4dd5af3912f5ce67ec64007d54a63
fix up adb to prefer /sbin/sh if it exists

Change-Id: I5c15731c95d123488e90aaeac5b497f556b53363
Merge branch 'cm-12.0' of git://github.com/CyanogenMod/android_system_core into cm-12.0