Hers was a celebrated literary life, set in and around Hollywood, where she was the queen of witty, uber-cool fiction. But a new book, ‘Notes to John’, which documents her most intimate therapy sessions, also shows a woman crushed by shyness and terrified of revealing what was truly tormenting her, says Robert McCrum