Resolve hostames for peers with caching

Some implementation of a long awaited feature:
http://dev.deluge-torrent.org/ticket/1896

* resolves hostname for each peer in separate thread, asynchronously
* retries a few times if resoving failed
* keeps all hostnames cached per torrent
* number of entries in cache is limited