Bluetooth: Refactor discovery stopping into its own function