Don't access a dangling pointer

The surface's resource may have been destroyed, return a null client
in that case.

Change-Id: I3d7e0f0e94008e003e43f1987e6560dd73f5c5db
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Merge pull request #24 from giucam/mer-5.4

Don't access a dangling pointer