A doctor charged in connection with the death of Friends star Matthew Perry has pleaded guilty to a charge of conspiring to distribute the drug ketamine.