Remove query from public list when it's destroyed

Fix #708.

Signed-off-by: Don Naegely <naegelyd@gmail.com>