LHC constraints on a mediator coupled to heavy quarks