Add object hierarchy sanity checking

[GF-4516] pbnjson::JGenerator::toString stuck in infinite recursive loop

Open-webOS-DCO-1.0-Signed-off-by: Janne Hurskainen <janne.hurskainen@palm.com>

Change-Id: I8a988f52027466d3c035baa1659249d89b28874c