Test / create errors directory before writing to it.

Closes #249.