Fix cmd_iter/cmd_iter_no_block blocking until timeout

Resolves #12617 (cmd_iter/cmd_iter_no_block blocks until timeout expires)