Police raided a militant hideout and shot three militants including the suspected mastermind of the Dhaka cafe attack during a shootout.