httptest was adding an extra flag, which was sort of ugly. Instead,
reimplement the parts of its functionality we were using. Bonus: due to
specialization, it's now a bit more efficient as well!
In order to avoid a dependency on the go.crypto terminal package, let's try to
do our own TTY sniffing. I think in practice this will work surprisingly well,
even if it feels incredibly sketchy.