A judge in the US has ordered that a Turkish student should not be deported after she was detained by immigration officials.