base: Fix null dereference when qualifying module path

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

Closes #1504