Bill Cosby wins pre-trial ruling in sexual assault case