libvirt: Stub O_DIRECT in test if not supported

`os.O_DIRECT` is only defined on platforms that support direct I/O. On
Macs, which don't support direct I/O in this way, `os.O_DIRECT` will
raise an `AttributeError`.

We can still test the code-path, however, by just stubbing out the
value on platforms where it's not supported.

Closes-Bug: 1286958

Change-Id: I8f10d6dfc4a63b6a961006b029b828e703870e46
Merge "libvirt: Stub O_DIRECT in test if not supported"