Close the inputStream to be safe