c: Reduce scope of request and socket mutex

Only hold socket mutex while sending to the socket.

Only hold request mutex if expecting a response. Don't hold it anymore
if there is no response expected.

This allows to call setters from one thread while another thread blocks
on a getter call on the same device object.