Improve style of boolean expr in states.git.latest

* `== None` –> `is None`
* `not X == Y` –> `X != Y`