testsuite: add a statement counter

And use it during testing to verify the number of queries executed
during sale checkout and showing client

Change-Id: I51054a07737992aee1c6b8ba0baa47c572bb896b