After spending some time on this problem, I figured out that the extension variable :
var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined;
isn't a string (thanks to console.log(extension); in firebug). This can explain that Google Anyltics isn't showing any Events.
So the solution I came up with was to change my code to the following :
_gaq.push(['_trackEvent', 'Download', '' + extension, filePath]);
After this the tracking is working properly.