detached-stash: refactor git stash pop implementation