Synchronize access to writing to the server