This allows to confirm that tcp_user_timeout parameter works correctly
for PostgreSQL connections, as specifying different values for it
results in different elapsed time before the query fails.
Use "_s" versions of the standard C functions if possible/simple to do
and disable deprecation warnings explicitly in a couple of places where
this could not be done instead of disabling them globally.
Also stop using strcpy() entirely and use strncpy() instead.
See #1268.