Pass a callback to allocate a cstruct of the correct size to write_payload

For the page-sharing implementation, make sure the mapping
is big enough to hold the payload.

For the file implementation, don't impose any size limit.

Signed-off-by: John Else <john.else@citrix.com>