Add basic HTTP read and connect timeouts so that applications don't hang indefinitely

I'm not sure what the timeouts should be for the rest api, but I'm pretty sure there should be some.

See also https://issues.jenkins-ci.org/browse/JENKINS-22245