You are right, this is a bug. The UPDATE has no WHERE, so every new job overwrites new_table_name for all rows in the history table.
It’s already fixed in PT-2422, the UPDATE now has WHERE job_id = ?. The fix is in Percona Toolkit 3.7.0-2 and newer, so I believe you run 3.7.0 or older ( the line number you quoted matches 3.7.0 ). Please check with:
pt-online-schema-change --version
After the upgrade only new jobs get the right value, the old rows in pt_osc_history stay as they are, so the fix will not clean them.