Right-wing opposition candidate Karol Nawrocki has narrowly won Poland’s presidential election.