grant: support both 'allocating' and 'non-allocating' interfaces

libxc always allocates buffers on our behalf, while in kernelspace
we have to manage our own buffers. This implementation supports both.

If a user sticks to the high-level functions and then links with
the correct C stubs, the result will work in both userspace and
kernelspace.

If an app needs low-level access then this will work for kernelspace
but fail at runtime with userspace (in addition to the runtime
failure for xen versions older than 4.2)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>