[runtime] Factor out the nested types computation code from mono_class_get_nested_types () and reorganize it so most of the work is done outside the loader lock.