Move Content-Length calculation to D2::Core::Response->to_psgi

Instead calculating it every time the content is set, it is done only
when the response is serialized to PSGI format.
If the Content-Length header is already set by that time (by
Handler::File, Handler::AutoPage or else), it won't be
recalculated.

Some tests were failing because of this change. They got fixed too.