Throughout his long and storied career, Stephen Sondheim has written memorable songs about the complexities, frailties and felicities of relationships.