TISTUD-6696 First time sudo prompt still fails to authenticate the user.

There is a timing issue with the current way of reading the output stream from the sudo password prompt. We might end up loosing the last line of password lecture/prompt when we loop to verify whether stream is ready to read.