a closure style wrapper for paramiko