Fix pushing executable files and symlinks, and add test cases

Previously, when changing and committing an executable file,
the file would loose its executable bit on the hg side.
This was not immediately apparent on the git side unless one did
a fresh clone.