Fix possible buffer overwrite in mt_xxpand
Some simplifications here and there
Refactor and optimize mt_hysteresis a bit

Also some meaningless changes in lutf
Some slight code polishing of support filters
Some slight code polishing in morphologic filters
Check if mask supplied to mt_merge has chroma planes when chroma is set to PROCESS and luma is false