git-am: refactor 'cleaning up and aborting'