Attempt to detect whether stdin is an interactive terminal.
If so, display password prompt and use stty to conceal password input. If not, just read the password without any fuss, as it is presumably being piped in programmatically somehow.