xrandr: Simplify code a bit.

Fixed some memory leaks.