Refactored LIBVIRT_THROW_EXCEPTION so that it will return the ThrowException object created.
Ensure that exceptions are thrown (and returned) when there is an error to throw.

Took this opportunity to also streamline those circumstances when a boolean is returned by consolidating the logic into a ternary operator as appropriate. Also ensure that resources that need to be freed are done so appropriately when throwing an exception.