Stuck completing master's thesis, how to overcome poor choice of topic and supervisor at this stage?
Both my partner and I felt exactly the same way towards the end of our respective master's programs (in totally different disciplines, at different institutions). I was advising her, and vice-versa, to just stick it out for a few more months and complete the program. We'd both put in so much work and effort up to those times, it would have been a shame to just totally wash out with nothing to show for it.

Now here we are a decade or two later, and both of our careers have been completely predicated on having those degrees as door-openers and a foundation for success. I really love my job in academia, and it wouldn't be possible if I hadn't completed that program. I just asked my partner if she could go back in time to that very difficult period, how she'd advise herself, and she said "Definitely, stick out! Get that diploma!". 

In both cases it took us about 5 years to mentally "wash off" that feeling of desperation. But we both feel so much better off, skill-wise, to have that under our belts. Best wishes; it does get better.