Issue #2988184 by jacob.embree, Pol, sjerdo, Jorrit: Fix call to count() on non-countable $links in theme_links()