hook: don't crash on syntax errors in python hooks
We had some real-world cases where syntax errors in Python hooks would crash
the whole process and leave it in an indeterminate state. Handle those better.
ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\nOK.