fix close magit-key-mode buffer when git-command failed