Fix waiting for device appearing in bluetooth scan getting stuck
