[messagefacility] Use target based lookup for tests

Replace use of add_test(<name> <command>) with add_test(NAME <name>
COMMAND <target>) to ensure test programs are found cleanly.