qrexec-client-vm may return earlier than it's child process (it exits right away, without waiting for its child). Add a small wait before reading exit code from a file.