With the mentioned patch, the crashes stop happening. Let's hope the match makes it into the next dovecot release.
As I went to prepare a patch to the FreeBSD port, I came across https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298769. This imports an upstream (Dovecot) patch that may also resolve the issue. I applied the patch and have no crashes in 24 hours.
Looking at the two patches, they both seem to address the crash (though the upstream Dovecot patch was originally prepared for another issue.) It seems the problem is with the net_getunixcred() differences across operating systems.
The previously mentioned patch makes net_getunixcred() work for FreeBSD whereas the committed patch bypasses net_getunixcred() to get the connection PID (which was the source of the anvil crash.)
There is other data in net_getunixcred() that will presumably be NULL but I'm not sure if that is an issue.