refs.c: allow deleting refs with a broken sha1

Add (back?) support to make it possible to delete refs that are broken.

Add a new flag REF_ALLOWBROKEN that can be passed to the functions to
lock a ref. If this flag is set we allow locking the ref even if the
ref points to a broken sha1. For example a sha1 that is created by :

   echo "Broken ref" > .git/refs/heads/foo-broken-1

Use this flag when calling from branch.c using a ref delete so that we
only allow locking those broken refs IFF when called during a branch
delete.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>