compositor-x11: Consider output position when computing relative motion

This fixes pointer movement for multiple x11 outputs. This was broken
when switching to relative events.

Fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=61672
Fix memory leaks

Fix a couple leaks caught by valgrind.