Enhancements for cplusplus based protocol handlers.

I think these would be useful for everyone.
I made these changes to enable cpp to be used as a protocol handler.
I have some cpp classes that I'll look at sharing once they are more fleshed out, if your interested.
Keep Clang happy you say. What error is it giving exactly? And is it correct in its warning? Maybe this `<cstddef>` C++ header should be included outside of the `extern "C"` stuff for all compilers?