Fix avm1 setInterval

With test!
Merge pull request #1155 from tschneidereit/master

Fix avm1 setInterval