[meson] simplify header checking
[meson] simplify header checking

Put everything in a function. Less error prone.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

github: #116

lighttpd/lighttpd1.4,gstrauss/lighttpd1.4,gstrauss/lighttpd1.4,gstrauss/lighttpd1.4,gstrauss/lighttpd1.4,lighttpd/lighttpd1.4,lighttpd/lighttpd1.4,lighttpd/lighttpd1.4,lighttpd/lighttpd1.4,gstrauss/lighttpd1.4,gstrauss/lighttpd1.4,lighttpd/lighttpd1.4