get_fuzzy_matches() cannot handle case where all
commands have the same Levenshtein distance
from searched command. It will bomb-out with
IndexError (dist[i][1] referencing one element
after the end).
It also does not handle no-commands case or
the case where searched command is the prefix of
all commands. The latter two cases are minor, since
'help' and 'complete' commands are always present.
We fix it by iterating over the partial result
safely, consuming only candidates with distance==0
(prefix commands) and those of the same minimum
distance.
Closes-Bug: #1500445
Change-Id: Iae5e77b64dc0d96e040acdcadf019db66a416648