McLaren secured its second successive Formula 1 constructors’ championship at the Singapore Grand Prix.