magit-run-git{,-with-input}: use unwind-protect

to make sure `magit-refresh' is run when git returns non-zero.