ugtrain: move the discovery stage 4 loop to discovery.cpp

We also only call it for stage 4, now.
ugtrain: remove FIFOs first to get empty FIFOs