Fix some issues detected by cppcheck

:Release Notes:
Fix too wide scope for local variables, useless initialization, useless
check for unsigned variables.

:Detailed Notes:

:Testing Performed:
Unit tests

:QA Notes:

:Issues Addressed:
[ANG-850] LS2: Investigate and fix issues detected by cppcheck

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I3e4e90fb1a301cb4b4a755f366f44f13f050e17c
Reviewed-on: https://g2g.palm.com/4665
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>