Racing fixes for the General.test_bug_23187_residue_delete_gui GUI test.
Some GUI interpreter flush() calls have been added to avoid racing in the GUI. The GUI tests are so
quick that the asynchronous user function call will be processed at the same time as the spin viewer
window is being created, causing fatal segmentation faults in the test suite.