[Libvir] RFC: safer memory allocation APIs with compile time checking