Don't allow deleting the head (checked out) ref

Closes #240