Improve the serialisation code for DH and RSA

SOFTHSM-83: The DHParameter code did not serialise the new length parameter.

The same code was applied to RSAParameter. The RSAParameter object was actually not fully serialisable.