Fixed handler destructor and memleak.

Handler destructor was called only if handler was brought down
while the server was running. Also it didn't free the context struct.

Change-Id: I8e71f4abc2bb314528416eeba063b48f2fb79773