Hang on, how is this not wrong? It's supposed to iterate through mapCryptedKeys but never gets past the first...
If one works, they should all work. If they don't then the wallet file is probably corrupted. So it'd be a nice check for corruption but doesn't seem to have much of a security implication.