Common: Add a clamp function to math_utils.h

Just bringing the common function utilities more up to date with upstream.