Replace cpPosTime cookie/parameter with cpPosIndex
This handles multi-DB transactions properly, instead of causing wait
timeouts in the WaitConditionLoop. It also is more correct in using
a counter instead of relying on wall clocks.
In addition:
* Refactor related code in MediaWiki.php to be comprehensible.
* Always send the cookie even the "remote wiki redirect" case.
* Renamed ChronologyProtector field and constant to avoid any
confusion of "wait for server X to reach Y" with "wait for Y
to show up in position store".
* Add an "asOfTime" field to the position keys for debugging.
Bug: T182322
Change-Id: I5c73cd07eaf664f02ba00c38fab9f49b609f4284