Ensure correct number of beams on DICOM conv.

In the case that the original RTP file contained field records that
wouldnt be carried over to the DICOM file with Plan#to_dcm, an incorrect
Number of Beams were previously encoded.
Ensure correct nr of control points with #to_dcm

The previous implementation was not very robust and would lead to a
wrong nr of control points being reported in some cases.