sim:epiphany: Move scache invalidation to end of main-loop

Move scache invalidations and flushing to the end of every main-loop
iteration.

This also fixes an edge-case in main-loop where an instruction would not be
invalidated from the scache when the core is woken up from inactive state.