Refactored and fixed almost impossible memory leak.

Previously curl_slist_free_all(cHeaders) called in loop after
many break statements, so there was no garantue that it will be called
in all cases.

This change also simplifies code to make implementing PUT/DELETE methods
easier.
network: Added PUT and DELETE request types
Updating http test url, removing www prefix.
fixed #2123: Refactoring network extension, fixing unlikely memory leaks, adding PUT/DELETE methods.
Merge branch 'curl_raii' of https://github.com/sergey-shambir/cocos2d-x into sergey-shambir-curl_raii

Conflicts:
	extensions/network/HttpClient.cpp
	samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp
Merge branch 'iss2133-curl_raii' of https://github.com/dumganhar/cocos2d-x into dumganhar-iss2133-curl_raii
Fixing compilation errors.
Merge pull request #2523 from dumganhar/iss2133-curl_raii

fixed #2123: Refactoring network extension, fixing unlikely memory leaks, adding PUT/DELETE methods.