SNetStreamDestroy(input_stream) causes more problems than it solves.
Ditch it.