JERSEY-2176: "Problems with calling close() and flush() methods on underlying output stream."
Groovy/Spock unit tests.

Change-Id: Iaf25815fad69bedd32e32721a3db76d7e61c649b