Top-ranked tennis player Jannik Sinner has accepted a three-month ban in a settlement over his two positive doping tests.