Fix for crash in BLE receive thread.