Speed up map.{intersect,common,union} a bit.

library/map.m:
    The implementations of map.intersect, map.common and map.union all
    loop over the elements in their input maps, and (under different
    conditions) add them to a new map. This diff changes the loop predicates
    so that they build an assoc list instead, which is then turned into
    a map (a balanced 234 tree) at the end. This avoids the construction
    of all the intermediate versions of the map, which would involve
    a lot of rebalancing.

    On the compiler, this yields a very small speedup, but the speedup
    can be expected to grow with the size of the input lists, since insertions
    into deeper trees need more rebalancing on average.