Rule 41(d) provides: If a plaintiff who previously dismissed an action in any court files an action based on or including the same claim against the same defendant, the court: (1) may order the plaintiff to pay all or part of the costs of that previous action; and (2) may stay the proceedings until the plaintiff has complied.