This can be unnerving and it may be how they respond to stress and difficulties in the relationship. Many threaten to leave as a way to try and shake things up to get things back on track. It can be very hard to live with this but the good news is that it has happened only twice in 13 years....that feels like a lot for sure as it is painful to go through. I would, in a quite moment, check back in and see where things are for both of you in the relationship, how you both feel and what you desire with one another. This check in could allow both of you to have an open and honest discussion so that these threats don't need to take place and you can figure out what you both desire. Be open, honest and loving.