windowManager: Only accept numeric values as Enum values

When doing a touch-pad driven workspace switch, JS is showing errors, this
is because the Meta.MotionDirection enum object also contains a "$gtype" object
and this value should be ignored, as it's not a valid direction.

The Object serializaion in fact shows:
  { "UP": -1, "DOWN": -2, "LEFT": -3, "RIGHT": -4, "UP_LEFT":-5,
    "UP_RIGHT": -6, "DOWN_LEFT": -7, "DOWN_RIGHT": -8, "$gtype": { } }

And so we should ignore anything that is not a number.

GNOME/gnome-shell!428
4 jobs for !428 with window-manager-scroll-motion-fix in 7 minutes and 27 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Review
passed #232373
check_commit_log

00:03:14

 
  Build
passed #232374
build

00:03:04

 
  Test
passed #232375
test

00:00:59

passed #232376
test-pot

00:01:08