Update count_relations to reflect new APIs of bgworkers

Those APIs have been changed since 9.3beta2 to reflect changes of 9.4
development due to dynamic bgworkers.