McLaren's Oscar Piastri won the Bahrain Grand Prix from pole position to slash the gap to Formula One championship leading teammate Lando Norris to three points after four races.