pgserve: fixes to allocator and some datum helpers

Signed-off-by: Alex Dubov <oakad@yahoo.com>