base: Fix null dereference when qualifying module path

This happens because resolve_path_dots() can return null for
invalid paths.