improve readability of switchToTab() method
Use correct branch to fix #505 and and #508

The following code ends up giving us the incorrect branch

https://github.com/Strider-CD/strider/blob/master/lib/utils.js#L19-L31

So we now detect this and attempt a recovery and report all of this in the logs.

```
9 Aug 12:41:25 - warn: possibly manipulating unintended branch (expected test, got *) ... trying to recover
9 Aug 12:41:25 - info: found and using intended branch: test
PUT /keyvanfatehi/dew/config/branch/?branch=test 200 71ms - 5b
```


Signed-off-by: Keyvan Fatehi <keyvanfatehi@gmail.com>
Merge pull request #513 from keyvanfatehi/508_recover_wrong_branch

Recover API branch inconsistency issues