Fix the conversion of a property key to an array index
Previously, a double was converted to uint32_t before its range was tested,
so a property key that is NaN, negative or larger than 2^31 made the
conversion undefined. UndefinedBehaviorSanitizer reported it for every VM
creation, where an environment variable name is atomized.
The fix is to test the range first and to share one njs_number_is_atom_index()
helper between the four places that repeated the pattern.