checkout: allow detaching to HEAD even when switching to the tip of a branch