Restore "stty echo" upon receiving SIGINT when asking for password
Shells do not generally have to restore line settings when a subprocess exists. This means that when the program asks for a password and is interrupted by Ctrl-C, stty -echo may remain in effect in these types of shells.
This MR restores stty echo when password prompt is interrupted by Ctrl-C.
(It also removes code duplication by introducing prompt_secret() subroutine.)