Militants have ambushed a Tunisian army patrol in a mountainous border region near Algeria, killing at least eight soldiers.