backport couch_stats_httpd from ASF