Celgene has managed to thwart several generic drugmakers who want to compete with cheaper versions of its medicines.