Preserve visibility cache when killing buffers
The section visibility cache is stored in a buffer-local value. For `magit-status-mode' and `magit-refs-mode' preserve that value using a repository-local value when killing the buffer and restore the buffer-local value when recreating the buffer. Other modes are not supported because they contain no sections that benefit from the visibility cache and/or because it is possible for multiple buffers with that mode to exist per repository.
Showing with 21 additions and 4 deletions