bin/luamin: Detect if stdin is a tty synchronously