Nortel posts 2Q profit thanks to shareholder lawsuit settlement