You should be running the same Dgraph Zero instance for the bulk loader and for the active cluster. Dgraph Zero handles the UID assignment.
As for figuring out the last used UID, those workarounds work. You can also check Zero’s /state page, which shows the maxLeaseId. That’s not necessarily the last used UID, but rather it tells you the highest possible UID that was handed out by Zero which is a good approximate. e.g., the maxLeaseId could be 10000 from which Zero has handed out up to 9942.