Fix printing of the last 10 lines of the error log with -j (again).

Fixes #1271.