Ensure pidftemplate is always 0-terminated

Coverity CID#1238650