examples/cogl-x11-tfp.c: Wait for the window to be mapped

Wait for the main window (and hence the window we create within
the main window to redirect) to be mapped and become viewable
before we try to call XCompositeNameWindowPixmap() -
XComposeNameWindowPixmap() produces a BadMatch error on a
non-viewable window.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
examples/cogl-x11-tfp.c: Handle WM_DELETE_WINDOW

Clean up cleanly when closed rather than dying with an X Error -
we do this by advertising support for the WM_DELETE_WINDOW protocol
and handling the client message.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>