Revert "bugfix: ngx.flush(true) might hang when there was a buggy output body filter. now we only test the condition "r->connection->buffered & NGX_LOWLEVEL_BUFFERED"."

This reverts commit 4ed6e7a54bf960f9993c30bfe0176c2ebda664e9.
minor code refactoring to make the ngx_http_lua_wev_handler function shorter.