Clean up error handling in resource directory.
- Response to /oic/res query of resource directory leaked the database
handle and associated file descriptors.
- Update/delete transactions could be non-atomic.
- Short-circuit error paths did not clean up properly.
Change-Id: I0a6cb8e8332e4f1d6c960d61c8a39320c1381b5f
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17793
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>