On the Shafarevich and Tate conjectures for hyperkähler varieties