core: fix class cast exception

This patch checks whether the mem size and CPU cores are integers or
strings, as it was changed recently in VDSM.

Change-Id: Ie35ada2685d71c6b295e3f39811d3f592d690fb3
Bug-Url: https://bugzilla.redhat.com/997401
Signed-off-by: Oved Ourfali <oourfali@redhat.com>