tcg: Introduce atomic helpers for integer min/max