Prevent instance/table from getting deleted while iterating
Prevent instance/table from getting deleted while iterating

The call to resume deletion of paused instances and tables happens
in the context of the main thread.  That could cause an instance or
table to get deleted via the Bgp::Config Task while the main thread
is iterating over them.

Fix by locking the scheduler when iterating over the instances and
tables.

Change-Id: I056119b72b8136764845c72334d58d8510961918
Closes-Bug: 1477669

sajuptpm/contrail-controller,vmahuli/contrail-controller,eonpatapon/contrail-controller,facetothefate/contrail-controller,sajuptpm/contrail-controller,hthompson6/contrail-controller,sajuptpm/contrail-controller,nischalsheth/contrail-controller,facetothefate/contrail-controller,rombie/contrail-controller,codilime/contrail-controller,eonpatapon/contrail-controller,sajuptpm/contrail-controller,numansiddique/contrail-controller,vmahuli/contrail-controller,nischalsheth/contrail-controller,rombie/contrail-controller,nischalsheth/contrail-controller,numansiddique/contrail-controller,hthompson6/contrail-controller,tcpcloud/contrail-controller,codilime/contrail-controller,nischalsheth/contrail-controller,tcpcloud/contrail-controller,rombie/contrail-controller,facetothefate/contrail-controller,numansiddique/contrail-controller,vmahuli/contrail-controller,nischalsheth/contrail-controller,numansiddique/contrail-controller,rombie/contrail-controller,hthompson6/contrail-controller,hthompson6/contrail-controller,nischalsheth/contrail-controller,sajuptpm/contrail-controller,tcpcloud/contrail-controller,eonpatapon/contrail-controller,eonpatapon/contrail-controller,vmahuli/contrail-controller,vmahuli/contrail-controller,tcpcloud/contrail-controller,codilime/contrail-controller,eonpatapon/contrail-controller,rombie/contrail-controller,hthompson6/contrail-controller,tcpcloud/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,facetothefate/contrail-controller,rombie/contrail-controller,numansiddique/contrail-controller,codilime/contrail-controller,eonpatapon/contrail-controller,tcpcloud/contrail-controller,facetothefate/contrail-controller,eonpatapon/contrail-controller,sajuptpm/contrail-controller,nischalsheth/contrail-controller,rombie/contrail-controller,nischalsheth/contrail-controller