Allow NULL as value for CURLOPT_CUSTOMREQUEST option.

Added test case.

Refactored the code to isolate the string handling. Fixed return values to use SUCCESS and FAILURE.

Removed unused error variable.

Indentation fix.
Removed the ugly goto.
Fixed expected output of a few cURL test cases
Merge branch '5.5' into 5.6

* 5.5:
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.