Some DHT hardening done.

See comments of added functions for details.
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core