Don't mangle the options object in res.cookie

Make a copy of the cookie options before mutating it to pass to
cookie.serialize. This prevents unexpected things from happening when
we try to use the same options object multiple times.

Also add a test to verify that the options object does not change
after a request is made.

This fixes #1449. I had been doing clones to work around this in my
own code, but I much prefer this solution.