connect with timeout

1. C API

adds a connect_with_timeout method accepting fractional seconds

2. C++ API

adds an optional timeout option to Client constructor and connect method