Malaysia has detained three men on suspicion of supporting the Islamic State militant group and planning attacks in Indonesia and Malaysia, police said on Thursday.