Add tests to make sure certain tokens are replaced

For accountResetTokens, passwordForgotTokens and passwordChangeTokens
we only allow one per accounts.uid and therefore when a 2nd one is
inserted it should be replaced instead of in addition to the first.
These tests make sure that this happens correctly.
Failed stored procedures return errors correctly

This test makes sure that if there is an error in a stored procedure
inside a transaction, that the error is propagated back up the stack
and into db/mysql.js. Trying to make an existing SP fail and putting
the correct one back into place seemed a bit fragile, so this adds
a new one (which we know will fail) and then monkey patches `db` so
that it mirrors the other methods by just calling `db.write()`. This
is about as close as we can get without it becoming spaghetti.