Report test name in case of runtest failure; add missing print_function.

Make runtests.py report the name of a test if an exception is thrown
before it outputs the test name normally. This makes sure that the
name of a test is printed even in the face of runtest machinery failure.

Added a print_function import from __future__ to test_codegen.py.
Without that, tests would fail all over the place with --enhance-asserts.