avoid calling external processes

Python already offers functions for chowning and chmodding files in its
standard library. The os module is even already imported. This commit removes
external process calls in favor of using these built-in Python functions.
1 job for master in 1 minute and 43 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Test
passed #9086176
build_stable

00:01:43