[HttpFoundation] Optimize ServerBag::getHeaders()

isset() vs in_array makes it take half the time (1ms/req here)
substr() does not have to scan the whole string so it's a wee bit faster
[HttpFoundation] Avoid a few unnecessary str_replace() calls