Jannik Sinner beat Hubert Hurkacz in the Halle Open final to claim his first title as world number one.