mod_base: make more resilient against non-utf8 path lookups. Fixes #604