Fix a memleak in torrentmodel.

Perhaps we should finally move to C++11 and std::unique_ptr?
Merge pull request #2106 from sorokin/fix-memleak-in-torrentmodel

Fix a memleak in torrentmodel.