Follow redirects correctly

If HTTP status indicates a redirect, write head to the response to have
browsers correctly handle the redirect.
Merge pull request #1 from vesse/master

Follow redirects correctly