Defer parsing of palette into colors
Addresses #6561
The discussion points out that Image.fromarray(a, "P") is slower than Image.fromarray(a, "L"). The difference is that when fromarray calls frombuffer, for P mode an ImagePalette instance is created. Once ImagePalette assigns the initial palette, it parses the palette into a colors dictionary. This parsing is the main difference in speed.
I'm not convinced that Image.fromarray(a, "P") is a common enough to warrant speed optimization. However, the parsing of the initial ImagePalette palette string would be an operation shared through all P mode images, and depending on the series of operations from the user, colors is not necessarily used afterwards.
This PR defers the parsing of the palette into colors until the colors attribute is accessed.