printers: Fix crash when panel is closed quickly

Fix a user-after-free while testing the connectivity to a cups
server. This is similar to the fix in commit 1d72a0b3.

This is an addition to the changes introduced in commit 2ff5cfd6
which allowed the connection testing to be cancellable.

Fixes #51
2 jobs for printers-fix-crash-when-closing-quicky in 12 minutes and 15 seconds (queued for 3 seconds)