Fix for issue #148 (Windows 8 hang on cancel)

This fixes issue https://github.com/wildabeast/BarcodeScanner/issues/148 which causes Windows 8 to hang when clicking cancel.