Fix some linting and other errors

- Catch previously uncaught sqlite3.IntegrityError
- Add logging to sleeps in locking (very noisy, they should come back out at some point)
- Reorder some queries to after the retries for loading an artist or album
- Enable more pylint checks:
 - C0303 whitespace between the end of a line and the newline.
 - C0325 a single item in parentheses follows an if, for, or other keyword
 - C0326 wrong number of spaces is used around an operator, bracket or block opener