The opposition has accused Tanzania’s president of clamping down on opposition as a general election looms.