Refactor: libpacemaker: Add colocations_header.
This moves code that is going to be useful in multiple places into its
own function.
This also fixes a missing paren at the end of the header that was being
printed out, which means the test output has changed. So also update
the test output.