net: throw on invalid socket timeouts

This commit restricts socket timeouts non-negative, finite numbers. Any other value throws a `TypeError` or `RangeError`. This prevents subtle bugs that can happen due to type coercion.

@misterdjules @tjfontaine