Refactoring of seamless cloning

This pull request brings several improvement to the seamless cloning routine in the photo module.

First, a number of unnecessary allocations have been removed, lowering the overall memory footprint of the methods.

Secondly, a number of method were re-written in order to improve the overall performances, resulting in a significant speed-up (at least x2)

Finally, a number of cosmetic improvements are brought in order to better comply with the coding guidelines.

Please note that this PR also contains the bug fix already proposed in PR #3283, but not merged yet.
Can you tell me what makes iterating over channels a bad practice ?
Regarding the `j*channels+c`, you are correct, however, according to the profiling I ran, this is not (by far) a performance bottleneck. I also think that this kind of premature optimization can reduce code readability.

Finally, please note that AutoBuffer is not in http://docs.opencv.org/trunk/modules/core/doc/core.html (as far as the search function go) (I'm not sure if here is the place to mention it).