Fix arrays.isArray() function (performance)

Solution based on try-catch block, relying on throwing an exception,
was extremly slow, what was visible e.g. during serialization.