Exit server mode gracefully