Better handling of out-of-env git_dir (fixes #406)

When the git_dir is outside of the submin environment (default:
/var/lib/submin), the subdirs could be created with incorrect permissions.

If for example git_dir is set to /var/repos/git, and the /var/repos/git
directory does not exist yet, it was sometimes created as root:root (ok)
with permissions rwxr-x-- (not ok, since neither the git user nor the web
user can then access it).

A new function is added that checks which directories need to be made and
only for those directories, creates them and sets permissions to a sane
default. If it already exists, it is up to the sysadmin to have sane
permissions.

The git update command will check if it has access to write a file and
will complain if it can not.
Add checks for git_dir permissions (fixes #408)

When the permissions for the git_dir are wrong, it might be that all git
commands do work, but the repositories are not listed. In this and other
cases the Diagnostics will complain.

This is mostly necessary for when the git_dir is outside the submin env. The
problem during 'git init' is already fixed (refs #406), but for the case that
'git init' was run with a version before this one, diagnostics will now show
which directories are wrong and how to fix them.

The 'unixperms fix' command does not complain about this, but I think that's
not a good idea since it is used in other commands as well (sometimes used by
scripts), so I'm not sure what will happen if I suddenly add warnings there.

In any case, the Diagnostics will show the incorrect permissions, so if
people see problems, they should run diagnostics.
Fix output of diagnostics for 'old hook repositories'