sdcard: Allow building as a static library

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