machines: Robustify VM delete operation in case it was performed during installation
machines: Robustify VM delete operation in case it was performed during installation

Before this commit, when a user clicked 'Delete' for a VM while it was
being created, the following racy scenario happened:

1: Delete operation first calls 'Destroy' API for the domain (See DELETE_VM function)

2: virt-install script would exit but the VM would still exist (not
   `Undefine` call processed yet, and
   pkg/machines/scripts/create_machines.sh continue by trying to
   redefine the VM in order to inject the metadata.
3: The `Delete` operation in not yet done, it will also try to call 'Undefine'
   API for the domain

The Undefine/Define API calls (steps 2,3) sometimes did not run in the expected order
resulting in the domain to not get removed in the end.

So by swapping the order of destroy/undefine in the 'Delete' operation
we make sure that when virt-install script exits (that happens when the domain get's destroyed)
the domain is not defined any more and the script won't try then to
redefine it either.

Also de-flakes TestMachines.testCreateFileSource.

Closes #14403
mvollmer/cockpit,moraleslazaro/cockpit,martinpitt/cockpit,mvollmer/cockpit,deryni/cockpit,moraleslazaro/cockpit,garrett/cockpit,mvollmer/cockpit,martinpitt/cockpit,moraleslazaro/cockpit,deryni/cockpit,martinpitt/cockpit,garrett/cockpit,moraleslazaro/cockpit,moraleslazaro/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,garrett/cockpit,deryni/cockpit,deryni/cockpit,martinpitt/cockpit,garrett/cockpit,martinpitt/cockpit,cockpit-project/cockpit,deryni/cockpit,cockpit-project/cockpit,mvollmer/cockpit,mvollmer/cockpit,garrett/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,deryni/cockpit,moraleslazaro/cockpit,deryni/cockpit