Save the current batch before shutting down.