x11grab: fix a memory leak exposed by valgrind