trace: Check process id also when the destructor is invoked.