demosaic: x-trans Markesteijn improvements

Speed up Markesteijn demosaic for X-Trans sensors, as well as reduce its memory usage. These changes should make it a 3-pass Markesteijn demosaic run 1.4x faster and will eliminate temporary buffers including a 4-channel float copy of the entire image plus padding.

Many optimizations here are from Ingo Weyrich, who has been implementing X-Trans support in the RawTherapee. A few others are homegrown to reduce memory usage when handling the image edges. Changes are summarized in the notes to each commit.