This fixes an issue where on some occasions the Zellij startup would be delayed by a few seconds until the terminal colors were queried.
This was happening because due to recent changes in the sending retry mechanism, the retry-queue was holding the lock on the session metadata for all messages.
This was fixed by only acquiring the lock when trying to send a message to the server, releasing it before placing it in the retry-loop.
This fixes an issue where on some occasions the Zellij startup would be delayed by a few seconds until the terminal colors were queried.
This was happening because due to recent changes in the sending retry mechanism, the retry-queue was holding the lock on the session metadata for all messages.
This was fixed by only acquiring the lock when trying to send a message to the server, releasing it before placing it in the retry-loop.