[modutils] add pkgutil.extend_path support. Closes #8796 [applied]