network: refactoring, fixed unlikely memory leak, added PUT/DELETE methods

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.

Second commit implements PUT and DELETE methods, adds test cases to TestCpp.