[SPARK-3546] InputStream of ManagedBuffer is not closed and causes running out of file descriptor

Can these three lines follow the `finally` block? the stream can be closed at this point I think.