Added timer on server exit to wait a bit for new clients. Don't remove the socket until the registry is closed to avoid a race.