Support inactive branch status and branch name with space(s)

This change introduce the support for inactive branch status (I am on mercurial 2.8):

```
$ hg version
Mercurial Distributed SCM (version 2.8)
```

The test repo reports this (with my modification for branch name with space):

```
$ hg branches -c
default                       45:7ac2dcb09643
my branch                     44:1695e75c32a9
another-branch                16:3e1ea66bdd04
branch-from-remote            10:16fac694db0a
new-branch                     7:63e18640e83a (inactive)
old-branch                     5:3cdad3d3ca00 (closed)
```

So new-branch was previously reported as "active", and will be reported as "inactive" with my change

Also I have added support for branch name with space(s).

test_branch_factory.rb has been updated correspondingly