Clear everything in the cache when closing the database
Added assert to make sure we do not generate more moves for boards that are game over