Filming nude scenes helped Sarah Shahi embrace her body. Playing an unhappy wife made her realize she should get a divorce.