Clone cached tables before returning them to users in mw.wikibase

So that any changes they perform will not persist between several
invokes.

Bug: T76946
Change-Id: I6a085bec4190cbf158ef72125885b9d51e1c51a5
(cherry picked from commit 37c1ab3eb1938147e1f7f5a75bf29b1daf3732ac)