Setattributes needs to take attr_lock
More lock improvements

Resolve a few deadlocks stemming from RLocks

- Don't take full lock on acquire_read until we've already checked that
  we don't hold it read already (resolves a deadlock where readers take
it once, a writer grabs it and begins to wait, then the reader tries to
take it read again).

- Don't unset writer_id until the last release_write() that actually
  unlocks the main lock.

- Properly serialize readers and reader_stack information with its own
  lock.

- Turn a thread upgrading a lock from read to write into a WARN
  situation, because it may cause deadlock. Of course, if we don't
detect it, it's already a deadlock so this is still better behavior, if
not good.