[CLEANUP] process_session: move debug outputs out of the critical loop

The if(debug&closed) printfs have moved outside of the loop. It also
permitted to merge several of them.
1 file changed