build: ensure that preinst and postrm are executable (fixes #19372)