Fix systemd check code in %post and %preun