cgi: More swrite error checks

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Follow on Bug #172: content_type fixes.

There is a problem with the sr data structure the
sr->content_type.data field  contains the content_type
value as well as the content_length value.This in combination
with the SHORTLEN value(64) leads wrong characters being copied
to the content_type ENV variable.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>