If cons script is waiting, goconserver could not aware of the status of the console connection. This patch check the environment when running the script, if it is gocons and retrying is needed, exit immediately.