Revert the movement of if_afdata_initialized to after we do the actual
work and keep it before under the same lock. The possible race condition
exists one way or antoher due to unlocking but in if_detach_internal() we
do check for if_afdata[] to not be NULL before trying to free, so not
extra harm is done.
Sponsored by: The FreeBSD Foundation