Fix bug in error handling during TOT initialization

This bug was exposed thanks to the new build system actually defining
HAVE_VALLOC.