Close stream in finally block