vm: add support for timeout argument

Added a watchdog class which executes a timer in a separate event loop in
a separate thread that will terminate v8 execution if it expires.

Added timeout argument to functions in vm module which use the watchdog
if a non-zero timeout is specified.