Make sure `kwargs=None` is properly handled. Fixes #16945.

Shouldn't this throw an exception? Kind of hard to sftp to something if there's no name defined.