Corrected bugs

-The app crashed when the windows got closed.
-It was sending emty strings as messages
-It was possible to try to send a message to a disconnected client,
making the program crash.
-It crashed when a client disconnected from the server.