Check if `licenses` table exists before loading the current license.

What does this MR do?

Check if licenses table exists before loading the current license.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

The upgrade from CE to EE is broken due to an issue with the licenses table not existing and the initializer expecting it to be there.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #3280 (closed)