Unbreak git_remote_ls on a local transport after disconnecting.

This fixes the issue introduced in #1675, where `git_remote_ls` would stop working on local transports after disconnecting.

@carlosmn @arrbee Can you take a look?