Dundee's Houdini-like bid for SPL survival has come to an end as a controversial second-half penalty denied them victory against 10-man Aberdeen.