magit-save-repository-buffers: fix error when not inside repo

Fixes #1540.