made RF::predictLabels() thread-safe