A historic Edinburgh pub that was forced to close after partly collapsing into a river is to be bulldozed for flats.