Closing window sends disconnect message

Now the server dosent have to wait for timeout before kicking a player,
as the player should send a disconnect packet. However, packet loss may
mean this is not received, so the timeout catches that.