A doctor who pleaded guilty in a scheme to supplying ketamine to Friends actor Matthew Perry has been sentenced but avoided jail.