Exactly the reason why I'm studying as an engineer next to my pilot job. It'll take me years to get the degree though. But the days of 45 year carreers with your national carrier are gone and will never come back, at least for the better part of all pilots. My advice is simple: even when you're employed, make sure you can quit aviation without hesitation the next day. If you can't, see it as a warning sign, because if you're forced to leave, you're in trouble.