NATO chief hails Turkish democracy after foiled coup