only canonicalize if needed

empty build about 3% faster

- patched:
$ measure.py 200 ninja
sampling: ...
best: 147ms
mean: 156ms +- 6.2ms

- unpatched:
$ measure.py 200 ninja
sampling: ...
best: 152ms
mean: 161ms +- 6.1ms