Made a correction in the safe guard of the capture streaming.
Previously, the resume handler was set to ngx_http_lua_subrequest_resume even when the subrequest is streaming, meaning the Lua code would return from a wrong context.
Fixed and tested.