Fix commit-ordering bug in mysql backend

This was showing up sporadically as 401s under load - we would occasionally go to use a token before the commit had finished flushing it to the database.  @dannycoates r?