Adding error checks for XCreateIC and XOpenIM.