Reset global MySQL status variables
After you are finished with a prepared statement, and executing it, be sure to deallocate_prepare_statement.  I think this will keep the counter from ever climbing to the limit.