revlog: make sure the files are closed after an exception happens
This prevents a corruption when the writes happen after the truncate
initiated by the transaction rollback.
Fix
issue995 (copy --after and symlinks pointing to a directory)
I haven't looked at other places that call os.path.isdir to make
sure they're OK.
dirstate: ignore mode changes if the fs does not supports the exec bit
This can make a difference when e.g. the repo is exported through NFS
(which support exec bits) and CIFS (which does not).