Make prepared statement test deterministic

Prepared statements pick connections to execute on at random, so just running #execute 10 times does not guarantee that all connections have been chosen. Run until all connections have been chosen, with a time out of 5 seconds.