Fix float division by zero

When calculating an appropriate number of hash rounds, if an attempt
was very fast, it might be measured as zero time, which would result
in a division by zero crash.