Make compatible with Apache commons codec 1.4

In pre-1.5 versions, this method will use 'chunking', causing invalid
HTTP. This adds trailing carriage return and line feed characters. This
patch tries to stay compatible with 1.4 as this version is provided with
multiple Java application servers, such as JBoss EAP 6(.1).

Warning: the Google http-client library also uses Apache commons codec
Base64 functions and may expect that encoded strings are not chunked
although it uses the affected methods.
At this time, only the
com.google.api.client.http.HttpHeaders.setBasicAuthentication method uses
the affected method. This method is not used in this library, but be aware
that downgrading the actual library may affect the working of the Google
http-client library.