Detect at runtime if the lcms2 function MemoryWrite is faulty

This allows us to switch to a slower, but non-buggy version of the profile
serialization code that uses a temporary file.