Lack of access to lawyers for immigration detainees being held in prison is unlawful, High Court rules