'peel' the target Ref before updating HEAD when checkout --force is used.

CheckoutOp was updating HEAD to point to HEAD when force == true, leaving the repository in an inconsistent
state. This patch adds a precondition check to FileRefDatabase.putSymRef(...) to avoid self refs, and makes
sure CheckoutOp 'peels' the target Ref before updating HEAD.