[ticket/12352] Do not check hashes that don't have the necessary length

This should significantly reduce the time spent on checking hashes of
passwords that should be converted.

PHPBB3-12352