OS-2845 catch errors on server.close() in case it's already closed.