Fix #5: Crash when scan is cancelled on iOS 7.1.2/iPhone 4S.

Added the fix mentioned in #5