Internal Documents Show How Close the F.B.I. Came to Deploying Spyware