lib: moved the timeout to a configurable variable.

This will make it possible to test.
The Timeout attribute in the net/http Error interface was added in 1.3

There are ways to make it to work in 1.2 and previous, but I just don't care.
It's too cumbersome compared to how simple I have it now.