st/xorg: add sanity checks after malloc