Use the following command when you want to leave terminal open but force sudo to forget password.

$ sudo -K