Fix ris contexts

The change in 8628536ad2f19c860aadf02da9cb1d2ffe61bc46 may have resulted in contexts that were not closed.  The code that closed the contexts was after:

    OutputStream aOutputStream = response.getOutputStream();

but this line was causing an exception (aef97ce).