Coiling Instability in Liquid and Solid Ropes