Add phutil_exit function
Summary: Triggers an event before exiting
Test Plan: Create a listener to handle the event.
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Maniphest Tasks: T3469
Differential Revision: https://secure.phabricator.com/D6326