CLOUD-209 Fixed invalid memory access and simplified code to parse If-None-Match header