chpasswd: fixes for shadow password handling