DRY: Combine doContentStoreRequest methods
DRY: Combine doContentStoreRequest methods

add a missing return to error handling block to prevent a second
response being written, and move the `defer` statement to right
place so that error response can we written correctly.

alphagov/publishing-api,alphagov/publishing-api