Only run at_exit handler once in case of forking