ooiion-1356 Clear out agent_config in agent_instance of device extended resource. 

Add check that agent instance resource is available.

@jamie_cyber1  please review