Reinstate fallback to ENV for tty_size()

Ref #7297

We really need a better solution for this generally (see #4117/#5709)
but I suppose reinstating `ENV` as fallback is easy for now.