make some stuff not blow the stack

Summary:
Even with `ulimit -s 100000`, this function was blowing the stack
on `flib/core/fbid/FBTypeStaticConfig.php` because it has ~150k
lines. It wasn't tail recursive because of the EOF exception
handling.

Turned it into a (drumroll) `while` instead.

Test Plan:
* ran `./fbt_extractor.opt ~/www/flib/core/fbid/FBTypeStaticConfig.php`;
observed the expected json output instead of a stack overflow

* make test shows 125 passed and 5 skipped

Reviewers: pad, michalburger1

Reviewed By: michalburger1

Differential Revision: https://phabricator.fb.com/D709329