Fixes for unused variables have been submitted upstream

Merge
  submitted/thread_21390/warning/fix-unused-local-var.patch
  cppcheck/fix-unused-local-var.patch
  warning/fix-unused-local-var.patch
into two new patches:
  upstream/CR24510/warning-fix-unused-local-var.patch
  warning/review-fix-unused-local-var.patch

Also move some chunks into warning/fix-uninitialized-var.patch.