Make settings server close cleanly