libpfrng: transform break condition into while condition