Planck 2013 results. XXV. Searches for cosmic strings and other topological defects