[NUCCORE-1216] Register query with ec (and deregister when it closes) so
that it is informed of the ec closing (so it can release results)