jQuery::addClass() behaves asynchronously? doesn't happen immediately and is blocked by confirm()

I use jQuery::addClass() to add a class to a row when clicking a button, and immediately open a JS confirm() dialog.
It seems as if addClass() was executing asynchronously as the class change is not reflected until the dialog is closed.
As addClass() doesn't have a callback parameter, I can't avoid this unless I call the confirm on a timeout, but I don't think that's reliable and may behave differently on different clients.
Any ideas on how to solve this?

Check this fiddle

Confirm opened, class change still not showing:

When the confirm is closed, the class change shows:


$("a.delete-email").click( function(event) {
    if(confirm("Are you sure you want to delete this email?'")) {
        // [...]