A federal judge has dismissed the National Rifle Association’s petition for bankruptcy, saying it was filed in “bad faith” in order avoid litigation by the New York Attorney General’s Office, which has sued to dissolve the NRA for allegedly misusing charitable funds.