One Direction singer had alcohol and cocaine in his system at the time of his death, an autopsy finds.