Check whether net.ParseIP returned nil or not

This is fix of #8102

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
daemon/attach: avoid mem alloc for interface

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #8169 from unclejack/avoid_attach_alloc

daemon/attach: avoid mem alloc for interface
Merge pull request #8125 from somaopensource/8102-fix

Check whether net.ParseIP returned nil or not