Sudden Stops and Optimal Self-Insurance