Try to be robust against fork.
trace: Check process id also when the destructor is invoked.
os: Prevent app from redirecting log messages.

This happens e.g., with SurgeonSimulator2013
Merge branch 'fork-safe' (issue #110)