We had few issues in the past using exit(), hence we introduced CRM_Utils_System::civiExit();