A cabbie says he feared being trapped in public loos all night after a council worker accidentally locked him in the building.