fix bugs in C++ protobuf_load/protobuf_dump

add a C++ level sanity check in test_protobuf
add more examples of shared values for NIW