“Phantom of the Opera,” the longest-running show in Broadway history, gave its final performance Sunday night with a star-packed red carpet and fond farewell from fans.