Fix json error handling

:Release Notes:
Fix json error handling during luna bus communication.

:Detailed Notes:
Add additional json check for sleepd 'setAlarm' reply.
Fix some json checks from 'obj == NULL' to 'is_error()'.
Minor fix with file descriptor.

:Testing Performed:
miniBAT

:QA Notes:

:Issues Addressed:
[GF-53668] Powerd: fix cjson errors processing.

Open-webOS-DCO-1.0-Signed-off-by: Alexandr Smoktal <alexandr.smoktal@lge.com>

Change-Id: Ia483988acaf6f434cc50611e43d5bc987d52fdde
Reviewed-on: https://g2g.palm.com/4104
Reviewed-by: DCO Verification
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Tested-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>