Fix tests that assume no dirty db state

* In mysql, tests are not running in transactions and in a random order so
  they can leave states behind. We have to use less strict matchers.

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>