Set $wasPosted = true for recursive API access

Having an API module instantiate a new ApiMain rather than doing things
directly is usually the wrong thing to do. But if you're going to do it,
you'll need to set $wasPosted on your DerivativeRequest.

Bug: 70448
Change-Id: Ic48ce53f19b1d849c5b51e1f3a190638e246e8ec
(cherry picked from commit 1be581df4728dc5f2310522bda06d3712c7b93af)