Fix resending headers following redirect

Fixes failing test - all header keys are lowercase
internally so comparison was not working as expected
and the header values were not being properly copied
by array_intersect_assoc as that function compares
both key and value.