gtlsinteraction: Hoist precondition before allocation

We're using a precondition in the middle of the function, and if we
hit it, we leak the closure.

Let's allocate the closure per path; this allows us to allocate it
before path-specific preconditions, and better avoids a pointless
malloc/free pair in the unhandled case.

https://bugzilla.gnome.org/show_bug.cgi?id=733576