Maximum likelihood estimation of log-affine models using detailed-balanced reaction networks