Since the Lambda functions are written in Node.js, you can probably take advantage of the way exceptions are handled and give your code a default timeout:
setTimeout(function() { throw new Error('timeout'); }, 1000)