Mateusz, thanks for following this up. Please note that in the original bug request, Mike Walker noticed a further problem with the version currently in HEAD.
His fix should therefore also be applied to HEAD, and hopefully MFCed https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256148 cheers, Jamie