misc.append_lines_to_file: respect sudo
misc.append_lines_to_file: respect sudo

Fixes: #10239
Signed-off-by: Dan Mick <b07550071eaa6a9296289c43bbd6c90559196431@redhat.com>

dreamhost/teuthology,ivotron/teuthology,ivotron/teuthology,SUSE/teuthology,zhouyuan/teuthology,michaelsevilla/teuthology,ktdreyer/teuthology,dreamhost/teuthology,caibo2014/teuthology,yghannam/teuthology,tchaikov/teuthology,zhouyuan/teuthology,SUSE/teuthology,ceph/teuthology,ktdreyer/teuthology,t-miyamae/teuthology,caibo2014/teuthology,dmick/teuthology,michaelsevilla/teuthology,SUSE/teuthology,ceph/teuthology,tchaikov/teuthology,yghannam/teuthology,dmick/teuthology,robbat2/teuthology,dmick/teuthology,t-miyamae/teuthology,robbat2/teuthology