inputevt_close(): use XFREE_NULL() to dispose of objects allocated via xmalloc.