plugin/core.c: Fix memory handling when running in SIM_SUPPORT_SMDB mode

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>