Thousands of Afghans face possible deportation after court refuses to extend their legal protection