Fixes bad casting caused by Tim on review. Make one definitive copy of sort_part_tier() in partition_msg.c and use it. Bug 3844, 5552.