Port the following PR that was ongoing in the `@metamask/json-rpc-middleware-stream` repo prior to its migration into the core monorepo. - https://github.com/MetaMask/json-rpc-middleware-stream/pull/23 (author: @iantanwx) There are some conflicts to resolve due to test rewrites that happen here: https://github.com/MetaMask/json-rpc-middleware-stream/pull/25.