Ancient defences of Leith unearthed