Fix memory leak in connection destructor.
Fix memory leak on connection error while pipelining commands.
Fix leaks and segmentation faults when replacing reader callbacks.
Merge branch 'fix-memory-leaks'