threadsafety: use $# instead of $1

That works around an issue with an "unbound variable" error
in latest automakes. Reported by LRN.