Only log the user if authenticated

This prevents attempting the reference an anonymous user. Normally
this would not be an issue, however apps like django-guardian create
a user with ID of -1 for integrity purposes. This check ensures we
are dealing with a real user.
Add setting that forces synchronous logging

This should only really be used when running unit tests to each thread
finished their work before the assertions are made.