Fix deadlock on destroy of CommandFactoryProvider.

A deadlock can occur when:
1) the CommandFactoryProvider is running in a thread from the
   startExecutor. It holds the this lock while running.
2) CommandFactoryProvider.destroy is called from the network thread,
   and blocks on the this lock. It also holds the network io lock.
3) The CommandFactoryProvider attempts to do io and blocks on the lock.

Fix the problem by offloading the destroy into thread in the
startExecutor.

Bug: Issue 1162
Change-Id: Iaa8658bd937a671ac0714c029ed6b7baa4637a4b
1 file changed