Only free EventData if it's successfully retrieved.

- straight from http://who-t.blogspot.com/2009/07/xi2-and-xlib-cookies.html
- hopefully fixes random crash on some systems