MB-9886 Correctly update certificate and private key file.

Change-Id: Icb010dda8571525ba4d9c99284b8a23201524c4f
Reviewed-on: http://review.couchbase.org/32339
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>