[IOT-1744] Fix for race-condition crash
The resource-container was crashing when due to failure to
grab a lock when the resorce container was being stopped
This resulted in code trying to use the resource container
at the same time it was being unregistered resulting in
a segfault.
Note: RemoteResourceUnitTest.onCacheCBCalled test is still
failing due to a different issue. That test must be fixed
before IOT-1744 can be closed.
Bug: https://jira.iotivity.org/browse/IOT-1744
Change-Id: I2dc5061c1693cc81c4f54a65a5233790fb5336d2
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16637
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>