[AS7-5439] wait for operations to complete before shutting down the server