Test: hopefully more robust PSYNC test.

This is supposed to fix issue #1417, but we'll know if this is enough
only after a couple of runs of the CI test without false positives.