Define and use standard errno codes

System calls now return informative errno codes on error (or, where a
positive return code would be ambiguous, the negative value of an
appropriate code).

Additionally, most of the changes from the previous commit are included
here, as I seem to have forgot the -a last time.