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