[BUGFIX] Category API does not consider multiple tables

Using the Category API with multiple tables, leads to wrong
results due to a missing check for the correct table.

Resolves: #45332
Releases: 6.2, 6.1, 6.0
Change-Id: Iaf5b453acd434ab8d8f58932a2c96385a66abf37
Reviewed-on: https://review.typo3.org/21963
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind