Fix #1343: Add a RetryingComJSEnv and use it for CI

You shouldn't test with a `PhantomJSEnv`, here. It might fail itself on the nth attempt, which is supposed to succeed, which makes this test as flaky as the old behavior. You should wrap a more reliable env instead, such as a `NodeJSEnv`.