Guard agains calls to closed device
Improved thread safety