makefs: use emalloc and friends
The emalloc set of error-checking memory allocation routines were added
to libnetbsd in r316572. Use them in makefs to reduce differences with
Sponsored by: iXsystems, Inc.