Test case and portability fixes

This series is a preparation for patches to enable building the binaries used by the test cases before deploying virt-test on the host. This (later) feature enables us to use virt-test with minimal targets that lack a compiler.
While preparing these patches, I stumbled upon some issues that were more general in nature, which I submit as this first pull request.

Thanks,
/Jonas