build: Use local macros to detect vala

Fixes build when vala < 0.19 is present.