detect_ip: avoid ResourceWarning about unclosed socket on python 3.x
fix minor PEP8 issues and typos
Merge pull request #29 from nsupdate-info/develop

detect_ip: avoid ResourceWarning about unclosed socket on python 3.x