libnetwork: Check for ipv4 flag in resolv.conf

* Add option for forced IPv4 resolution.
* Helps with #8293
* Very slightly modified patch by donn