Fix a performance bug related to projectile-expand-root

`projectile-expand-root` calculates the project root on each call, which
is a fairly expensive operation. This function should never be used
on more than a few files.