Fix memory issues found with valgrind

server module now has a destroy function (oops).  echoserver properly
cleans up after itself.  Also fix a leak, an invalid read, and improper
teardown logic in server module.