Correctly retreive the threadid from v8

This is an `int` not a `size_t`.