fix issue with validation against local refs

:Release Notes:
Fixed LS bug with validating using "definitions" from category
description.

:Detailed Notes:
- added test that exposes issue with referencing "definitions" local
  to category description
- fixed prepare_schema
- fixed segfault when pbnjson returns jinvalid bug reports no error
- error reporting from schema building

:Testing Performed:
unit/integration tests on desktop

:QA Notes:

:Issues Addressed:
[BHV-1592] Implement optional validation of received payload

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I9b26abcf8e0354098b2e201c82c0b685fd1a9c43
Reviewed-on: https://g2g.palm.com/5672
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>