ALLJOYN-2274 Fixed memory leaks found in ajctest

Change-Id: I918a66b5c8cf020777d4086aaae261f727b3f284