ALLJOYN-1724 Wait until a worker thread is available before yielding controller role.

Change-Id: I605f774273601054988994753b6c151781bc503b
ALLJOYN-1750 Resolve Klocwork memory leak issue.

Change-Id: I9e045e85f4e07aa80f4acec2f1612dac8a78f231
ALLJOYN-1750 Fix memory leak detected by valgrind.

Change-Id: Ib3f70cd473555c564eaf51f9cb1b3b781eba845d