Change all malloc/calloc/strdup calls to XNEW/XNEW0/XSTRDUP macros.

These macros will abort the program using err() instead of our
previous attempts to just close the connection on malloc/calloc
failures. It turns out libev will just abort on alloc failures, so
trying to gracefully handle our own alloc failures is pointless.

Note that previously strdup() calls were all unchecked, possibly
resulting in strange behaviour on failure.

Import err.h and sysexits.h for err() exit with error message and
EX_OSERR standard returncode.