register sys exit (thanks to John Schulman)