Use separate timeout for each AP connection attempt.

With this pull request, the timeout in connectToAP() is reset for each connection attempt, allowing subsequent connections to succeed even if a previous one timed out. Without this change, if the connection attempt times out once, subsequent attempts timeout immediately, since timer is already at 0. That makes it almost impossible to connect after an initial timeout.