Optimize updates to goal_infos.

compiler/polymorphism.m:
    For some setter predicates of the goal_info, the value being written
    is frequently the same as the old value in the written-to field.
    Make these setter predicates not do the update if it is unnecessary.