Fix for use-after-free by if_ioctl() calls from user-space in USB drivers by
detaching the ifnet before the miibus.
PR: 252608
Suggested by: jhb@
Sponsored by: Mellanox Technologies // NVIDIA Networking
(cherry picked from commit 4eac63af23ddafc2b1dfb2aad2896f4513c37cdd)