wm-tester: correct NULL pointer check

Closes https://github.com/mate-desktop/marco/pull/144
compositor: fix possible dereference of NULL pointer

Closes https://github.com/mate-desktop/marco/pull/145