Fix bug: couldn't set cookie if callback param was supplied.

It was failing in this case because the response had already been started.