Cherry-pick errno-related fixes

* Linux errno compat improvements
* errno -> str translations for NetBSD errnos
Source for buildrump.sh git rev 7e72e189f154928b3ca4230a046e1ddef7690b86