cleanup_pipe(): prevent potential double free by setting free()'d pointers to NULL
Cleanup cmsDeleteTransform() calls a bit