Adding getallheaders() when it's not defined.

Fixes #383