Backport --max-time patch for wikibase dispatching changes

Change-Id: If5e6b23b15bb6e7eddb4d3838fd3c3d653e5c5ef
Merge "Backport --max-time patch for wikibase dispatching changes" into wmf/1.21wmf8