Device: Various improvements: added missing functions, mutex, threaded recv loop