magit-section-set-visibility-hook: new variable

Add new hook variable `magit-section-set-visibility-hook'.  Run it
in `magit-insert-section' to set the visibility of a section, before
all the other approaches used to decide whether the section should
be shown or not.  Hook functions have to return nil if they don't
care, else `hide' or `show'.
preserve visibility of files in revision buffer

Moving point in the log buffer automatically updates the revision
buffer.  In that buffer file sections (and most other sections) start
out expanded, but if the user collapses a section then it stays that
way when displaying another commit.  Except that it doesn't always,
e.g. if commits A and C modify foo, but B only modifies bar, then
hiding foo in A will be forgotten in B and once C is displayed it is
expanded again.

Counter that by keeping a buffer-local list of files that are to be
hidden again the next time they are encountered.