Refactor decref() to lock node only on last reference
requested to merge 3811-reduce-lock-contention-in-the-qpzone-part-2 into 3811-reduce-lock-contention-in-the-qpzone
The detachnode() and decref() would always lock the nodelock even in cases where the node reference would be greater than 1, so no action would be taken. By reordering the contents of decrement_reference() and changing the meaning of its return value by incorporating the checks from detachnode(), we can avoid the locking when the node is referenced by more than one user.
Closes #3811