Compton tails in long-duration gamma-ray bursts