Unset the work restart flag sooner in avalon_flush_work to avoid re-entering the flush work function and just reset the queued counter instead of rotating the array to avoid runs of no valid work.