Arrangement with US National Security Agency comes as AI lab is locked in legal battle with Pentagon over Claude model