mod_base: make more resilient against non-utf8 path lookups. Fixes #604
core: added z_context:prune_for_spawn/1. Fixes #645