try to fix module-caching test
win32: reduce allocation in the scheduler

It's not clear that the changes affect anything in practice,
but they avoid unnecessary allocation and quadratic behavior
in principle.
module caching: ensure consistency of directory paths

Use `path->directory-path` to normalize directory paths and
increase use of the cache.