Make sure to include trailing NUL when copying path into cache, and when
performing comparison for cache lookup.