Enable fetching curl

Review 1624 by @larkost
Closes #2400
Fix for #2541
Fixed wrong type. Caused overflows and broke GC.
Merge branch 'v1.13.x' into next