now check several times for red status before fail

- environments sometimes transition from grey to red to green,
  rather than going directly from grey to green
now checking for old_env_name right before terminating it

- to avoid a race condition where another build switched the came
  while we were waiting for our new environment to come up