Register the at_exit handler by default
Merge pull request #200 from halorgium/at-exit-by-default

The lack of the at_exit handler causes hard deadlocks