Core/messages: Partially revert 1ae273e140e5f88325b4152859c5af09785fd687, which was causing errors on whitespace-only messages.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
Core/connection: Better queue handling on quit.

Signed-off-by: Martin Stone <martin@d7415.co.uk>