ptrace: Make terminating event deduplication new mechanism more generic.

The previous commit broke this:

    while ./src/proot ./tests/rootfs/bin/test-ptrace00; do true; done