Add references to the string parameters while we are doing a connect; this prevents the underlying library from referencing invalid memory.