Bug 1028152 - Improve wait for b2g to be resistant to JavaScript exceptions. r=me