Fix bug #740932. Transform should update the sha cache.
This updates TreeTransform so that for files that it creates, it calls tree._observed_sha1
This should mean that 'build_tree' and even 'merge' will now pre-compute and
save the sha hash for all files that we touch. Anything that takes a long
time should end up able to save the sha hash for the newly created files.
It ended up more invasive than originally expected, because of a pre-existing bug
that stat values stored in the Dirstate did not always match both os.fstat and
os.lstat on Windows, because in Windows the two are not equal (dev and ino are
sometimes but not always 0, depending on python version, etc.)