magit-refresh-buffer: make sure BUFFER is non-nil

In `magit-refresh-buffer' make sure BUFFER is non-nil, instead of
using `current-buffer' instead of BUFFER.  This makes using that
buffer nicer than just passing BUFFER or else `current-buffer' to
`with-current-buffer'.
magit-refresh-buffer: reduce nesting
magit-refresh-buffer: update commit marker later

In `magit-refresh-buffer' call `magit-refresh-marked-commits-in buffer'
right after `magit-highlight-section'.  Therefor call it becomes the
very last step of refreshing; however the real point is not to do it
in between some unrelated steps (which are related to each other, just
not the commit marker).
magit-refresh-buffer: actually sync point in other windows

`magit-refresh-buffer' did already attempt to update the "window local"
point in other windows showing the same buffer.  However it failed to
request all such windows from `get-buffer-window-list'; it only
requested windows of the current frame, which in most cases equals to
the selected window.  Now we process windows from all frames.

This fixes the special case mentioned by me in issue #687.  At least
in most cases, that is when this function is *actually* called.
magit-refresh-buffer: remove bogus entry from window-buffer

In `magit-refresh-buffer' remove bogus entry from the list returned by
function `window-buffer', which effectively did throw away all the work
done further up in this function.

In most cases this did not happen because there was no such bogus entry
in `window-buffer'.  However when a command did move to some other
buffer and did only then refresh the buffer we ended up with such an
entry.  The entry is created when switching away from the buffer.
Refreshing is done by first erasing the buffer and then rebuilding it
from scratch.  Erasing the buffer causes the markers in the entry to
become invalid and since we have already switched away from the buffer
earlier then rebuilding the buffer contents neither creates a new entry
nor updates the markers in the existing entry.

This fixes issue #687.
magit-refresh-buffer: also restore the window-start

This fixes the issue of which #978 is a special case.
Merge branch 'pr/window-point'