Fix EZP-20804: updateindexsolr fails if timeout is lower than exec time

# Description
For users with a large subtree or those who changed mysql default timeout value (8 hours). It is impossible to reindex solr because the mysql connection times out and breaks the script.

In order to fix that we can recreate a new connection more often.

# Test
Manual test.
I started the script with the default timeout in verbose mode (it didn't break), at the end it displays the execution time. Then I setup the timeout to a value smaller than the execution time.