SWIG/oc_core_res: Fix lifetime of add_device_cb

Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
4 jobs for master in 11 minutes and 28 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build
passed #3282
Android_build

00:11:26

passed #3283
doxygen

00:05:21

passed #3280
Linux_Secured_Test

00:05:45

passed #3281
Linux_Unsecured_Test

00:05:26