Retry login rather than crashing the process.

Fixes https://openedx.atlassian.net/browse/LMS-11272 by attempting to log in every five seconds if the first time failed. Users will have to monitor the log file to know whether there's a configuration problem.

@carsongee @e0d