fixed extension issue

On file with multiple dots, extension is broken
Eg: on {ext:'.js'} myscript.prod.dust => myscript.js, instead it should
produce mysqcript.prod.js