Added thread dedicated to stopping devices. Need to add signalling
to indicate when client has called stopDevices.
Fixed issue with stopping protocol.