[r=andreserl][bug=][author=allenap] Backport of r3299 from trunk: Avoid deadlock in Node.release().
Node.release() now obtains locks in the database in the same order as other updates to nodes, changing the hostname for example, so eliminating the chance of deadlock.