The Donald J. Trump Foundation will close and give away all its remaining funds under judicial supervision amid a lawsuit accusing the charity and the Trump family of using it illegally for self-dealing and political gain, the New York attorney general’s office announced Tuesday.