fix reading gzip headers & add test for inflate gz headers