Fixed a potential hang in both wired and wireless

We need to be sure that nothing is using the input device before we unregister it, including asycnronous work. We shut down in urbs and flush asyncronous work as such.