Logic variables allocated in Query are freshened wrt input, not empty context

Fixes #31