There was an issue where we couldn't use callbacks and call a second query after a prepared statement failed. This is because sync() was never called in this case. This PR does two things:
Remove built-in ready for query flag in internal error cases and always sync after an error
Add new flag to make sure we only call the callback once in an error case
There was an issue where we couldn't use callbacks and call a second query after a prepared statement failed. This is because sync() was never called in this case. This PR does two things: