pop the loop block even for infinite while loops (closes #23048)
make sure server threads get cleaned up