Add flag for retaining layout version

Needed on Sony mint (Xperia T) as the /data/media folder is a
separate partition and normal data media wiping is not appropriate
for this device but the layout version file needs to be retained
for Android 4.2 multi-user.
Add build flag for custom graphics
Fix problems with thread creation on some devices

This fixes a problem with not reaching the backup completed page
after a backup is complete on certain devices (GNex, Note2).
Changing the stack size to 512KB seems to be the actual fix but
leaving the other changes in place as they may be helpful or are
better practices.