WIP on inventory background fetch
Let statemachine honor approvements.

The inventory bulk fetch is not thread-safe, so the it doesn't start
right away, causing the approvement not to be honored upon return from
post_approved (formerly post_nb).

This patch renames wantsMoreHTTPReqestsFor to approveHTTPRequestFor,
and has it return NULL or a AIPerService::Approvement object.
The latter is now passed to the CurlEasyHandle object instead of just a
boolean mQueueIfTooMuchBandwidthUsage, and then the Approvement is
honored by the state machine right after the request is actually added
to the command queue.

This should avoid a flood of inventory requests in the case
approveHTTPRequestFor is called multiple times before the main thread
adds the requests to the command queue. I don't think that actually ever
happens, but I added debug code (to find some problem) that is so damn
strictly checking everything that I need to be this precise in order to
do that testing.
Ask approvement for each HTTP request.

The old code could do up till four requests with only one approvement.
Now we just start to assemble the four types of requests until either we
can get approvement for one, or one of them gets too large. This way we
still request everything in the same order, and at LEAST as many per
call as before, assuming we get the approvement of course.
The result should actually be faster because now we will request up to 5
folders or items per capability, and not spread those 5 out over 2 to 4
capability requests.
Lets CurlEasyHandle::approved() stay consisten throughout its lifetime.
Queue/throttle fix.

If AIPerService::add_queued_to fails because a new request is throttled,
then do not add the request to the end of the queue, nor remove it from
the queue: do nothing: it makes no sense to move the request to the back
because they all belong to the same service and all of them will be
either throttled or not.

Note: Still need to fix that in this case we should look in queues of
other services.