Fix out-of-scope stack in IPEndPointBasis::SendMsg (#10340)
Fix out-of-scope stack in IPEndPointBasis::SendMsg (#10340)

- chip::Inet::IPEndPointBasis::SendMsg, when using sockets, in some
  configurations, can use a temporary stack buffer that is no longer
  in use and may have been overwritten partially by other data.
- Fix is to hoist the buffer to the outer scope that uses a pointer
  to it, so that it remains live

Testing done: ran unit tests and cert tests on all-clusters-app

Fixes #10338
nestlabs/connectedhomeip,project-chip/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip,nestlabs/connectedhomeip,nestlabs/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip