Tone curve filter: bug fix, always add the last point as it is never added.

Previously the last point would not be added correctly if the last point's x < 1.0 as there would be fewer than 255 entries in the output array. So the output points would approach but not actually get to that final point.

If the final point was y=1.0 it wouldn't matter as we go on to extend the returned array out to x = 255 with y = 1.0s. But if it wasn't then we'd miss that last value.

Also clarified the question in comments about whether the length of the points array is equal to the length of the second derivative. It is. Also made the n variable a constant in the second derivative method to ensure it.
Tone curve filter: correct application of RGB in conjunction with R, G, B channels.

The RGB adjustment must be made after the R, G and B adjustments.
Merge pull request #1071 from karlvr/tonecurvefixes

Tone curve filter: fixes missing last point and incorrect application of RGB curve in conduction with individual channels