Check the return value from XShmAttach.