Restore "Avoid aborting context before DSpaceObject is used."

This reverts commit 8628536ad2f19c860aadf02da9cb1d2ffe61bc46 and restores c1e126a788cc45e5fba512bdba87977327f6abda
Close context before writing citations
Removed response calls to getOutputStream() since we are using getWriter().

They are mutually exclusive, and calling response.getOutputStream() after response.getWriter() results in a java.lang.IllegalStateException.

From http://docs.oracle.com/javaee/5/api/javax/servlet/ServletResponse.html:

> To send binary data in a MIME body response, use the ServletOutputStream returned by
> getOutputStream(). To send character data, use the PrintWriter object returned by
> getWriter(). To mix binary and text data, for example, to create a multipart response,
> use a ServletOutputStream and manage the character sections manually.
Merge pull request #524 from datadryad/fix_ris_contexts

Fix ris contexts