make fmpz single implementation threadsafe