gold closes with $18 loss, pacing metals selloff