netif_utils: correctly close fd on read error