[sr-dev] git:sr_3.0: core: fix return not working inside a while() loop