tracers: leaks: fix signal handling
I resurrected the old patches from @ystreet and @tpm from the Bugzilla. After some digging I think I finally found a solution for the "start thread before forking" problem!
I preserved the history of the original patches but we may want to do some squashing before merging, assuming the original authors of the patches don't mind.