Fixing a possible blocking synchronization issue when shutting down a
server.