Losing your job right before retirement is stressful, but the right steps can protect your savings and long-term security.