Fix segfault on server when client disconnects