Resolv fixes, including CERT VU #210620

This pull request fixes a few isseus in the `resolv` code:
* CERT vulnerability note VU#210620: http://www.kb.cert.org/vuls/id/210620 This pull request randomizes DNS request IDs to make them difficult to guess
* A few compiler warnings about unused variables
* Autostart the resolv process if it wasn't started by the `main()` code
* Fix a NULL bug if debugging is turned on