It'd be nice to move this out to a prototype method, like `this._doSCP(p, tmpfile)`, and then the `.bind(this)` can be on line 96, so there's one fewer closure to keep in mind.