Don't use a spinlock for reference counting if we have no threads.