Court voids law prohibiting unmarried police officers from getting pregnant