Handle input from stdin properly in varnishadm

readline doesn't really handle when input comes from a file or pipe,
so only use readline if stdin is a tty.

Thanks to johnnyrun for a patch which was used for inspiration here.

Fixes #1314
Fix buffer overrun in varnishadm pass function

Spotted by: Coverity