Generate parsoid cookies from the flow manager

When the $wgFlowParsoidForwardCookies flag is set that means parsoid
needs a Cookie header passed or it will be unable to make requests
back to the wiki.  From maintenance scripts there is no cookie to forward,
so this tries to mock one up only when PHP_SAPI === 'cli'.

Change-Id: I9775385a6091cb4e5d9bcdba789a7494447fff6e
(cherry picked from commit cce3eb5434062c25b2e01c0c481162f1a9f1e94a)
Merge "Generate parsoid cookies from the flow manager" into wmf/1.25wmf11