selftest: Improve error handling and perl style when setting up users in Samba4.pm