dirstate: make parents() faster.
This allows localrepository.status() to avoid reading all but the
first 40 bytes of the dirstate in the common case of running "hg
status".
localrepository.status: only acquire wlock if actually needed.
This speeds up the common case of not needing to update the dirstate,
and avoids the need to reload and parse the dirstate "just in case".