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

curRunner can only be changed by the using Thread (ComJSRunners are not thread-safe). However, there is a race between completion of the currently running inner runner and the (potential) replacement. This is why synchronization is needed.