Implement cairo image surface for memory DC in wxQT

As for wxWindowDC, it uses an image surface internally until cairo qt surface is implemented.
This was causing a SIGSEGV in unit tests.
Fix wrong condition (copy pasting error) in text ctrl sel