Sorry if I'm being overly detailed, but if you lose your job when in the later stages of a green card there is portability to a new employer, so there are options.
However, I do agree the uncertainty can be stressful. I went through a layoff when on H1B and it's not fun!