Thanks for reporting the problem. I have installed the attached two patches, which I think should fix the problem so I'm closing the bug report. Please give them a try on NetBSD (as I typically don't use NetBSD).