I've personally been fortunate to have been able to form a network of a bunch of different well-connected folks so I can always choose who I get to work with in the event that companies shut down or get acquired or such and such. I feel the value of such a network does not get touted often enough.
Finally, I accepted the solution was long-term. I made a long-term plan - to do what I really loved - and focused my attention on that, and slowly built up the resources, skills, etc. for that plan. One wonderful side effect was that the dead-end part diminished in my mind; sure, I still had to do it, it still sucked and there were some awful days, but it would pass. I didn't matter so much; those people didn't matter; it was like one of those movies where the kid knows that someday they will leave the depressing, dead-end town they are stuck in today.
I hope that helps a little in your situation! Good luck!