Fixed issue with HeaderOptions not correctly being sent
Fixed issue with HeaderOptions not correctly being sent

If HeaderOptions count was greater than 1, the sender side did not correctly
allocate and copy the memory for it, resulting in the second headeroption being
an invalid read/copy, thus resulting in garbage data in the second HeaderOption.

This fix ensures that ALL header option data is correctly copied.  Validation
shows that the rst of the stack is working properly, so the correct data will
be transferred.

Change-Id: I08d9ccf8943bf7e85f6d24055b5f11881ba2bd24
Signed-off-by: Erich Keane <ec9f61fe526c14bb62c55d7c978f025ee6b3583d@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/153
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: Sudarshan Prasad <18992b2df49d20c769d3f89a8cc0a9f38a9dccaa@intel.com>
Reviewed-by: Sakthivel Samidurai <2b42ef6ad9ddc9eb44e2c60668b448d90a7d2d41@intel.com>
Reviewed-by: Sashi Penta <32e61e548782370d3f4bdf383408e385d155e3e6@intel.com>
Reviewed-by: Ashok Babu Channa <72ac47ef856ca3d131a57cba474ebed48591eeff@samsung.com>
Tested-by: Ashok Babu Channa <72ac47ef856ca3d131a57cba474ebed48591eeff@samsung.com>

santais/iotivity,kartben/iotivity,iotivity/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity,tienfuc/iotivity-democlient-snap,iotivity/iotivity,santais/iotivity_1.1,rzr/iotivity,santais/iotivity_1.1,iotivity/iotivity,rzr/iotivity,tienfuc/iotivity-democlient-snap,iotivity/iotivity,iotivity/iotivity,tienfuc/iotivity-democlient-snap,WojciechLuczkow/iotivity,iotivity/iotivity,santais/iotivity_1.1,rzr/iotivity,WojciechLuczkow/iotivity,WojciechLuczkow/iotivity,rzr/iotivity,santais/iotivity_1.1,iotivity/iotivity,santais/iotivity_1.1,santais/iotivity_1.1.0,santais/iotivity,santais/iotivity,tienfuc/iotivity-democlient-snap,kartben/iotivity,WojciechLuczkow/iotivity,santais/iotivity_1.1.0,santais/iotivity_1.1.0,kartben/iotivity,tienfuc/iotivity-democlient-snap,kartben/iotivity,kartben/iotivity,rzr/iotivity,kartben/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1,tienfuc/iotivity-democlient-snap,santais/iotivity,santais/iotivity_1.1.0,santais/iotivity,santais/iotivity_1.1.0,tienfuc/iotivity-democlient-snap,WojciechLuczkow/iotivity,santais/iotivity,santais/iotivity_1.1.0,WojciechLuczkow/iotivity,kartben/iotivity,WojciechLuczkow/iotivity,rzr/iotivity,WojciechLuczkow/iotivity,tienfuc/iotivity-democlient-snap,iotivity/iotivity,santais/iotivity_1.1.0,kartben/iotivity,rzr/iotivity,santais/iotivity_1.1,santais/iotivity_1.1