uhttpd: properly handle return codes