Fix make_categorical_dtype so it works with readonly arrays