Ensure the "errstr" buffer is always 0-terminated

Coverity CID#1238651 (and many others)