Fix to avoid shortening the command line on tab completions.

This prevents cases like `cd /usr/e` from tab-completing to
`cd /usr/` (which is the shared prefix of the tab completions).

Things are still sort of confusing with fuzzy matching, e.g.
with files like this:

    foo1bar
    foo2bar

Then ba<tab> will replace the token with foo. That's surprising,
but not new to this fix.

Fixes #1727