The snail lemma for internal groupoids