snippets: Use g_task_is_valid instead of G_IS_TASK
g_task_is_valid additionally checks that the source object is correct (https://developer.gnome.org/gio/stable/GTask.html#g-task-is-valid).
g_task_is_valid additionally checks that the source object is correct (https://developer.gnome.org/gio/stable/GTask.html#g-task-is-valid).