Greece and Turkey have agreed to talks to avoid accidental clashes in the Eastern Mediterranean, NATO Secretary-General Jens Stoltenberg.