Fix races in tests

I sometimes had fails for `TestDiffEnsureOnlyKmsgAndPtmx`, `TestTopNonPrivileged` and `TestTopPrivileged`. After this fix I have no fails for this tests at all.