[transfer-engine] Fix memory leaks
Merge pull request #26 from monich/leaks

Fix memory leaks