Indonesian police apologised after a video circulating on social media showed officers using a snake to extract a confession from a suspect.