Thread safety improvements
Thread safety improvements

ms-iot/remote-wiring,turkycat/remote-wiring,ms-iot/remote-wiring,bfjelds/remote-wiring,ms-iot/remote-wiring,bfjelds/remote-wiring,bfjelds/remote-wiring,turkycat/remote-wiring,turkycat/remote-wiring