Shutdown sshd correctly and better python context/destruction handling