Turkey pledges to change terror law to win EU visas