[SPARK-3797] Minor addendum to Yarn shuffle service

I did not realize there was a `network.util.JavaUtils` when I wrote this code. This PR moves the `ByteBuffer` string conversion to the appropriate place. I tested the changes on a stable yarn cluster.
this is not safe for bytebuffers which are allocated off-heap -- Netty has already looked at this problem, so maybe we should just use their solution:

```return Unpooled.wrappedBuffer(b).toString(Charsets.UTF_8)```

For symmetry, we could use
```Unpooled.wrappedBuffer(s.getBytes(Charsets.UTF_8)).nioByteBuffer()``` on stringToBytes