Delete an existing branch reference.
If the branch is successfully deleted, the passed reference object will be freed and invalidated.
A valid reference representing a branch
0 on success, or an error code.