Initial 'smpsocket' implementation
Added frees before program exit

This allows us to detect leaks far more easily using valgrind.
If we free everything we know about on exit, anything left over
is a leak.