Properly close the socket watcher