C++ MajorDomo example now works for zmq 4.x / bugfixes

This patch is focused on the MajorDomo example for C++
* The code was non-functional due to changes in the past two zmq major versions
* Memory leaks and crashes have been fixed
* A final commit to clean up some of the existing code