tests: add regression test for #3164
tests: add regression test for #3164

This is a race condition, so to make it more likely to fail (if it's
broken), make some things manually. In normal circumstances this order
of actions is also possible, just less likely to happen. But as seen in
the bug report, happens from time to time.

QubesOS/qubes-issues#3164

marmarek/qubes-core-admin,QubesOS/qubes-core-admin,woju/qubes-core-admin,QubesOS/qubes-core-admin,marmarek/qubes-core-admin,marmarek/qubes-core-admin,QubesOS/qubes-core-admin,woju/qubes-core-admin,woju/qubes-core-admin,woju/qubes-core-admin