Refactor with ToTargetCompatibleHandle()

Refactor statements doing host-to-target handle conversion, eg.

   uintptr_t hndlptr = (uintptr_t)hostHandle;
   unsigned int hndl = (unsigned int)hndlptr;
   assert(sizeof(hndl) == sizeof(hndlptr) || hndl == hndlptr);

into a call to ToTargetCompatibleHandle()

Change-Id: I0bcfb37f1b50679d29e7f21fe230ad433fbbef7c
5 files changed