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.
it's quite unoptimal. You must avoid excess `copyTo`. As far as I can see you can use:
```
cvtColor(gray, gray8, COLOR_GRAY2BGR);
```
Instead of:
```
vector <Mat> temp;
split(destination,temp);
gray.copyTo(temp[2]);
gray.copyTo(temp[1]);
gray.copyTo(temp[0]);

merge(temp,gray8);
```
It should be ok if `channel == 3`