Check handle is stdin

Check the console handle is stdin or pipe