Add connection lock to websocket transport
Related tasks
Context
A race condition occurs when when the connection inside the websocket wrapper is being used.
Change
This MR adds a lock to prevent multiple interactions on the connection by different method calls.