Correct placement of window event flush for window state

A bad cherry-pick meant that 155363 put some code window flushing code
inside the wrong function. This fixes where the flush should occur.

Change-Id: I468d9881d08c358cf559a12d52b18702db3cb1e0
Merge pull request #15 from mikkoharju/master

Destroy extended surface object
Make frame callbacks part of the pending commit state

Commit to frame callbacks only on commit.
Check for null surfaceBuffer

If client detaches the buffer and commits, check for
null surfaceBuffers.
Fix qt key extension interface name
Do not mess with paint enabled on surface mapped/unmapped

If QWaylandSurfaceItem is used as a texture provider only,
setting paint enabled can cause item itself become visible.
Immediately send frame callback on detach

Might not be according to wayland protocol but
better to send the callback than not.
Commit on detach

On some platforms mBuffer is always zero. Expect setVisible(true) to
result in paint, and explicitly detach and commit on setVisible(false)