The FBI foiled the teenager’s plan to attack a grocery store, the agency said.