This patches clear out the StreamPromise when the scanning is stopped. This allows the CBPeripheral to be correctly released.
It also force the scanning to be stopped after a timeout (which wasn't the case before) and make sure the timeout failure promise is called only if the scanning wasn't stopped before.
This patches clear out the StreamPromise when the scanning is stopped. This allows the CBPeripheral to be correctly released.
It also force the scanning to be stopped after a timeout (which wasn't the case before) and make sure the timeout failure promise is called only if the scanning wasn't stopped before.
Should fix #16