MDL-43884 database: Fix get_tables() api for external stores