Custom response writer with support for capturing response code.