api.c: libhttpd crash on invalid HTTP headers

Added patch fix for second hand of the bug (http://dev.wifidog.org/ticket/471).

This patch comes from benoigt.