traceprof: report profile data even on error
Update the traceprof contextmanager to always print the profile information,
even when exiting due to an exception.
In particular, this fixes the behavior so that we report profiling information
even if a slow command is interrupted with Ctrl-C. This also matches the
behavior of the upstream statprof profiler.
Confirmed that a profile was printed when interrupting a long-running
hg log -f command in a large repository.
Reviewers: quark, #fbhgext
Reviewed By: quark, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D386