Fix and relax locking
Only connected devices are available devices
Merge pull request #930 from AudriusButkevicius/avail

Only connected devices are available devices