#597 fix memory leaks
Merge dev in to issue597 branch
Decrement tx_data reference count (not increment)!
Fix merge conflict
Fix merge conflict
Merge pull request #598 from Metaswitch/issue597

[Reviewer Andy] #597 fix memory leaks