[TIMOB-18028][TIMOB-18031] iOS: Static Analyzer fixes

Cherry Pick PR #6350 and PR #6351 into 3_5_0_64-bit branch.

Merged to this branch to avoid merge conflicts later when merging back to master

Fixes 
[TIMOB-18031](https://jira.appcelerator.org/browse/TIMOB-18031)
[TIMOB-18028](https://jira.appcelerator.org/browse/TIMOB-18028)