Easy workaround: <Enter>~.<Enter> in terminal from where you started ssh. This will make ssh to close connection immidiatly. Not a general solution of course, but will fit in many practical cases.