BLE Host - Limit to 2 consecutive OS events.
BLE Host - Limit to 2 consecutive OS events.

Prior to this change:

When the host had work to do, it would process its eventq until it was
empty.  This is the correct behavior for most tasks, since the OS will
interrupt the task when a higher priority task has work to do.  However,
this is wrong for the NimBLE host because the host doesn't have a task
of its own; it runs within a parent task.  This previous behavior caused
the following two problems:

1. When the host sets a timer, the timer is associated with the parent
task's eventq.  When the timer expires, it is the parent task which
executes the callout.  If the host is busy with an endless series of
events (e.g., during scanning, if the application logs every
advertisement), then the callout never gets processed because the host
event queue is never empty.  This is especially problematic in the case
of scanning, because it is a time which terminates the scan procedure!

2. The parent task could get starved when the host had too much work to
do (again, the example is when logging incoming advertisement reports).
This isn't as big of a problem, because the application could always
move functionality out of the parent task and into something with a
higher priority.

New behavior:

After the host processes two consecutive events, it relinquishes control
back to the parent task.  If the parent task has no work to do, control
is immediately given back to the host.

andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,IMGJulian/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core