What is the best way to measure current and voltage through a diode
Short answer: non of the above.


  the author pointed out that in characterizing a diode(I, V relation )
  there is an unavoidable error due to the ammeter and voltmeter.


If this has to be done with any accuracy (and why shouldn't it), before any mention of measurement techniques you should consider how to apply current to a diode so that it doesn't get warm. You may think that this isn't important but, any reasonable characterization should include how the device works at different temperatures BECAUSE the forward volt drop of a diode not only is affected by current but quite significantly by temperature.

Because of this, the best test set-up (or if not the best then one I would consider to be adequate) is to design a highly accurate current source capable of applying calibrated current pulses to the diode. The pulses should not be of any significant length of time in case the device warms more than (say) 1 degree. We're probably talking about pulses of no-more than 1 ms.


  In what case will the first arrangement be preferred over the other?


So, neither of the questions arrangements are adequate other than for teaching the VI characteristic to basic beginners. This is because an ammeter isn't needed because the source itself should have been designed to produce a darn stable current (on demand) AND, if you tried to use an ammeter it would have to take readings at a specific instant in time and "hold" that reading.

This also means that a standard voltmeter is also not capable of recording the forward volt-drop because it would not know when the 1 ms current pulse was applied.