add response wrapper + simple mechanism to ensure safe close handling fo...

...r writer vs outputstream