Safe exit for gprof.