Bug 1028261 - Fix to exit with a non-zero code on errors

Why this change? We have noticed that `/storage/sdcard` is a path used by the Flame, but afaik `/storage/sdcard0` is still a potential path.