Dispose Stream on the brink of throwing IOException.