Fix rather serious indexing bug that was causing experiment indicies
to be reused if the DB is dropped and recreated, since when that happens, auto_increment history is lost and it will go back to using the latest highest index in the table. Usually not a problem, but since we cross index three other tables using the experiment index, this causes quite a bit of grief. So, my solution is to do my own auto_increment using the experiment_stats table (locked of course), which we never delete entries from without deleting all entries from the other cross referenced tables. DBQueryFatal("select MAX(exptidx) from experiment_stats"); I also added a sanity check to make sure the new index is not currently in use in any of the tables. I also cleaned up the error path when something goes wrong.