exec.library: fix loop exit condition for managed memory