fix memory leak in zero-copy allocation

it appears to have been sensitive to
where in the function `malloc` is called.

Calling it later appears to fix the leak.

This is crazy.

Along the way, I cleaned it up to use one malloc of a struct with two ints,
and create the zmq_msg_t in the free_fn,
so if a leak returns it won't be so severe.