Fix computation of start and end of each partition of the string.

This is to fix IndexOutOfBoundsException when length of input is
divisible by maxCookieSize. I have a pull request for test-cookie-session-plugin that have unit tests for this too. Hope you will accept this.

Thanks!