Who was appointed commander-in-chief of the texas army and began retreating in order to prepare soldiers for battle