mock loads its configuration as the user that sudo names, so a
configuration without chrootuid builds as SUDO_UID. mock_chroot_uid
runs the loader as root and reports uid 0, and mock_result_dirs then
gives the result directories to root.
Under umask 077, mock_result_dirs creates the work and package
directories as 0700. The build user cannot reach the result
directories below them.
Add a sudo-caller case to the native mock test, and a fresh-tree case
under umask 077 to the result-directory test. Move writable_as into
t/lib so both tests share it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>