Refactor: pacemaker-attrd: use variable for whether to write
... for readability and to reduce code duplication