Magpies forward Thomas retires from AFL