Court tosses NY case that could have expanded gun rights