Court overturns data collection lawsuit ruling against NSA