The Justice Department announcement, in a court filing, ends an immediate legal battle over the San Bernardino shooting case but raises questions about Apple’s security.