Enable flake8 E711 and E712 checking

E711 comparison to False should be 'if cond is False:' or 'if not cond:'
     comparison to None should be 'if cond is None:' or 'if not cond:'
E712 comparison to True should be 'if cond is True:' or 'if cond:'

Most violations were in DB queries. Replace as follows:
  False -> sqlalchemy.sql.false()
  None  -> sqlalchemy.sql.null()
  True  -> sqlalchemy.sql.true()

Change-Id: Iff54747b70f504d5466cfdc6e2ec4d7a0f9ddb7c
Closes-bug: #1305377
Fix H302 violations in db package and services

Change-Id: If5e07fa4529430ba90d9c7dd81d28ceeee00ebe0
Partial-Bug: #1291032
Merge "Enable flake8 E711 and E712 checking"
Merge "Fix H302 violations in db package and services"