[IOT-1611] Memory corruption in OCSetAttribute
[IOT-1611] Memory corruption in OCSetAttribute

Fix memory corruption bugs in OCSetAttribute introduced by
https://gerrit.iotivity.org/gerrit/#/c/14377/ which left pointers to
freed memory in the attribute list, which was then later used.

Change-Id: Ib776d4bd14aab7b39c74188246005628fbe18ecf
Signed-off-by: Dave Thaler <8a98d0850f57b73c42d096f8f8b11e2d5522d554@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14873
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: Uze Choi <3a26c91d8a4a3c9e246e43339f4782bb2483aece@samsung.com>
Reviewed-by: Phil Coval <ff46fec9739d31cce915aabcc3a7a2c00eee4d6c@osg.samsung.com>
Reviewed-by: Habib Virji <40be98b50fb6c4d79bd282a617e2cc82e300d47f@samsung.com>
Reviewed-by: Ziran Sun <3baa2a3e3c6d96dba4b6f1736d53815847db9a07@samsung.com>
(cherry picked from commit f4217dab180e728271e79d5a3ea314c39fb1d628)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14905
Reviewed-by: Dan Mihai <ba8e1833495515b49ded9e20cae80a8129155aa9@microsoft.com>

iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity