Fix thread checkpoint issue

This changes a do...while loop into a while(true) with
a break out.  Fixes issue where checkpoint functions can
cause the thread state to become overwritten by a garbage
value.

Bug: 11809176
Change-Id: Ifbbc5e5cee85649d57f71267933539eefa7e25ea
1 file changed