Implement JSPromise.timeout(ms)