Fix bug when modifying the startFrame of a layer

Two events were sent to the server at once, which triggered a double
simultaneous write of layers.json.

This mostly resulted in the endFrame update overwriting the startFrame
update, and sometimes even an extra `]` at the end of the file for some
mysterious reason.