Replace the deprecated table.getn() with the length operator

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>