What if the problem is not from this code, but underneath? I'll try to suspend and resume without having Xorg running. Would that help in any way?