fs.Visit() returns nil flag

Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>

2 bugs really - `FlagCount()` was returning the internal count - `sortFlags()` reduces it, and `sortFlags()` assumed that the incoming map was indexed by the primary name of the flag, when it can be any of the names.