read and discard zero chars to initialise STDIN

Resolves issue in cygwin on windows 8.1 where password field is skipped. See later comments of issue #2831.
Merge pull request #3094 from TomK/patch-1

read and discard zero chars to initialise STDIN