Fix infinite loop detection error - fixes T3158

Summary:
This fixes infinite loop detection where width/height are involved,
and adds a test for it.

Test Plan: - Run pjs/output_test.js tests

Reviewers: john

Reviewed By: john

Subscribers: #cs

Differential Revision: http://phabricator.khanacademy.org/D13166