End popup grab only if client is available

Prevents from crashing.

Issue: #62