move threading lock into BaseEmailBackend