Fix tests.

Since Response::_sendHeader() throws an exception if headers are already sent
(which is the case when running tests), the method needs to be mocked in all
tests.