Don't include the filename in the error output

This changes the log output if we use a random temp directory.
Fix a crash when we try to validate <p></p>
Use __attribute__(cleanup) to simplify memory cleanup