minor code cleanup

git-svn-id: http://libtorrent.googlecode.com/svn@9818 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda
fix bug in DNS cache

git-svn-id: http://libtorrent.googlecode.com/svn@9819 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda
more invariant checks

git-svn-id: http://libtorrent.googlecode.com/svn@9820 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda