Fixed #226 - Eliminates ordering issues in the SyncMessage protocol

This prevents a server crash in that specific case. Everything else is handled by event listeners (onclose) so the server reacts appropriately.