Federer, even in defeat, gets the end worthy of a historic career