resolve forward imports

if any __init__.py file on the way up the directory tree until the
basedir contains an import of the target name or '*' from its module,
that forward-importing module will be used.