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

Originally I was going to check channel is null or not, but I forgot at previous PR.
Now I've modified.