Bug 1039943: make gallery exit if it goes to background while scanning on a 256mb device or smaller

Use < 512mb instead of <= 256mb as the threshold
Bug 1038261 - Fix to handle both sdcard and sdcard0
Merge pull request #22433 from JonHylands/jhylands-1028261-reference-workload-exit-error-code-v2

Bug 1038261 - Fix to handle both sdcard and sdcard0
Merge pull request #22374 from davidflanagan/bug1039943

Bug 1039943: make gallery exit if it goes to background while scanning o... r=pdahiya