Well, geez - of course you're insecure when she threatens you with leaving! That part has little to do with the affair, and lots to do with the fact that you really don't feel like she's committed to working through the tough times.
Unfortunately, that part of the illusion - that we're married for life and our partner will stay committed through thick and thin - kinda dies with the affair. I'm happily reconciled (most days, anyway!) and I do think my H and I will make it through the long haul - BUT - I know now there's no certainty involved in that.
You may want to approach your wife with something like this:
"Wife, recently we went through a stressful time with my unemployment. I know it was very difficult for both of us. It concerns me, though, that your response to this stress was to threaten to leave the marriage. I believe we both need to learn better ways to work through our problems. How do you think we can approach future challenges in a more constructive manner?"