commit: add a check if it is trying to close an already closed branch head
It would check if the revision we are going to close is already a
closed branch head and print the error message accordingly.
Differential Revision: https://phab.mercurial-scm.org/D6491