Fix infinite loop when regexp ends on line

Fixes issue #696

Review URL: https://github.com/google/traceur-compiler/pull/697

Closes #697.