MFC r351214:
Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose(). PR: [[ https://bugs.freebsd.org/239893 | 239893 ]]