This is the patch: https://github.com/curl/curl/commit/9ea3a6e150dfc822ba1565f649b634848597d2d9
thanks for the report, this should be fixed in =net-misc/curl-7.51.0. please test since i added this patch to an already partially stabilized ebuild. i tested and it worked for me, but another tester would help. reopen the bug if there's some issue.
just compiled on rpi and it does work.