doctor: consolidate directory access checks

Also include a writability check for lib.

Closes #18571.
doctor: 'raring' => 'ready'

It was pointed out that 'raring' is a rare word can be confusing to
non-native speakers.

Closes #18659, see that for details.