FBI misused intelligence database in 278,000 searches, court says