QWindowCompositor: Prevent double delete.

With a SHM client, if a null attach happened, then the old buffer would be
deleted but left with a dangling pointer which would be deleted again on the
destructor.

This was revealed by tst_dialog.

Change-Id: I89e22487e7ec982789a4b7dfd45e5db7db3222d1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>