AJCORE-1308 Fixed issue found using static analysis tool

We were using an assert to make sure the end of an iterator
was not being used.  Asserts are compiled out of release
code so we needed to add code to handle if the iterator is
invalid in release code.

Change-Id: Idffe2820e4b3541baf164ccf41b12170e5f30db9
Signed-off-by: George Nash <georgen@qce.qualcomm.com>
Merge "AJCORE-1308 Fixed issue found using static analysis tool" into RB14.12