Use canonicalFile for calculating relative paths

Gradle seems to hand over files which have been converted to their
canonical forms, so pass the base through in canonical form so that
the relative path is calculated correctly when the canonical path
is different (e.g. when symlinks are resolved).