Geometric Optimization of Nonequilibrium Adiabatic Thermal Machines and Implementation in a Qubit System