I have previously implemented this suggestion and it works, sort of. The problem is there may be several units in the plot capable of building the improvement, and some of them may or may not be actually building. In my case, in Dune Wars, I have added a "slave" unit which can build any improvement twice as fast, but it is killed at the end of the project. So my code in onImprovementBuilt finds any slaves on the plot and kills them.
There are two problems. (a) the slave may have been just passing through. (b) A player pointed out an exploit: have 2 slaves and one worker build the improvement until it is one turn away from complete; then move the slaves off the plot. When the worker finishes the improvement by himself, no slaves get killed.
Although the exploit bothers me a little, the effect is close enough for me, and I left it this way. I could imagine an sdk change which would pass along the pUnit of one unit who completed it. But it should really be a list, and it would be extremely hard to record all units who had contributed to building it in the past.