Check if inside repo before trying to save buffers

`magit-init` would fail when there were any modified buffers because
`magit-pre-call-git-hook` calls `magit-maybe-save-repository-buffers`,
which, when not in a repo, results in nil being passed as an argument to
`string-prefix-p`.