don't call magit-refresh-function if nil

The check against magit-refresh-function was dropped in
8aa75bf025f9353642c719a46b0257d1467ee90d, when magit-mode-refresh-buffer
was changed to magit-refresh-buffer.
Merge pull request #1434 from npostavs/safe-refresh

don't call magit-refresh-function if nil