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
Merge remote-tracking branch 'cm/cm-10.2' into cm-10.2