Thousands of protesters took to the streets of Istanbul after Turkey pulled out of an international agreement designed to protect women from domestic violence.