NetBSD build fixes

Buildfixes from master that are required for building
heimdal-1-5-branch on NetBSD.