The role of defects in thermoluminescence of pure and rare-earth-doped magnesium tetraborate phosphor