Western cultural stories tend to emphasize perseverance. But science shows that knowing when to quit has a place in our success too.