Switch from deprecated MIME::Head->set() to ->replace()

MIME::Tools 4.x (in 1998) deprecated ->set, in preference to the more
explicit ->replace() call; ->set is no longer documented in POD, in
fact.  Switch all places which use the former to using the latter.

Fixes I#18417
Merge branch '4.2/switch-mime-header-replace' into 4.2-trunk