Simplify map_labels::set_label() by factoring out some find()s.

In two places, the code from get_label() was basically duplicated,
presumably because the public get_label() function returns a pointer
to a const object. I added a private version that returns a pointer
to a non-const object, and now set_label() is easier to read.
Some cleanup of map_labels::set_label.

Two changes might warrant further explanation:
1) No need to set a property of an object (current_label->second)
   that you are about to erase.
2) Setting res to NULL when it is already NULL is a no-op. (This
   line exists because at one time res was set to something other
   than NULL.)
Clean up the logic that decides when labels are created and shown.

Fixes bug #21434.