[qtdeclarative] Make sure the visibility state is the same in GUI and Re...

...nder threads.

show() would add a window to the GUI thread's list of windows.
handleExposure() which is called asynchronously from show() would add
it to the render thread's list. hide() would remove it from both GUI
and render in one go. That meant that for a short while after
win1.show(), win2.hide(), the GUI thread would have an entry in its
list (from show()) while the render thread had none (not yet delivered
through handleExposure()).

This had some side effects. If we entered polishAndSync() at this
time, the GUI thread would enter the sync lock and post an event, but
as the render thread doesn't track any windows, it would never pick it
up and the system would deadlock. Also, if an incubation controller
was awaiting the incubation signal (as told via
interleaveIncubation()) it would never get it.

Also, a separate thing, but related. To make sure nobody is waiting
for an incubation signal when the render thread stops, emit an
incubation signal after the render loop might have stopped, just to be
on the safe side.

Change-Id: I8d88bb149370f053be9c53cede59eb9920456983