Do a COMMIT each time we check for incoming mail to avoid MySQL caching

While trying to get the TWFY test suite to run, I found that the version
of MySQL on wheezy was caching the results of the query that looked for
incoming mail.  Doing a COMMIT each time round the loop made the results
update correctly.