Military officers have seized control of Guinea-Bissau and detained the president.