inherit: optimize eclass search

Use PORTAGE_ECLASS_LOCATIONS variable ordered so that we can break out
of the eclass search loop as soon as the first match is found.