Capillary thinning of elastic and viscoelastic threads: From elastocapillarity to phase separation