Server now closes properly without crashing, and socket properly unbinds