shared: Ensure control message type valid for serialize
shared: Add asserts to greedy_realloc
shared: Handle problems in buxton_data_copy

Assert on required inputs and zero out our output if there is a
problem with data copy.
test: Add tests covering the rest of util.c