device: fix crash when master connection fails

When the master AC becomes ready, activate_stage1_device_prepare() is
called in a idle handler. If the master AC fails in the meantime, it
will change state to deactivating or deactivated. We must check for
that condition before proceeding with slave activation. Note the the
'master_ready' flag of an AC is never cleared after it is set.

Fixes: 5b677d5a ('device: move check for master from nm_device_activate_schedule_stage2_device_config() to end of stage1')

https://bugzilla.redhat.com/show_bug.cgi?id=1747998
17 jobs for bg/rh1747998 in 64 minutes and 20 seconds (queued for 1 minute and 19 seconds)
latest
Status Job ID Name Coverage
  Test
passed #561032
allowed to fail
checkpatch

00:02:40

manual #561037
allowed to fail manual
t_centos:7.5.1804
passed #561038
t_centos:7.6.1810

00:30:42

passed #561044
t_debian:10

00:18:55

passed #561043
t_debian:9

00:18:38

passed #561046
t_debian:sid

00:17:51

manual #561045
allowed to fail manual
t_debian:testing
passed #561033
t_fedora:28

00:35:43

passed #561034
t_fedora:29

00:43:02

passed #561035
t_fedora:30

00:36:44

manual #561036
allowed to fail manual
t_fedora:rawhide
passed #561039
t_ubuntu:16.04

00:26:11

passed #561040
t_ubuntu:18.04

00:24:25

manual #561042
allowed to fail manual
t_ubuntu:devel
manual #561041
allowed to fail manual
t_ubuntu:rolling
 
  External
failed https://desktopqe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/beaker-NetworkManager-gitlab-trigger-code-upstream/648/

failed https://desktopqe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/beaker-NetworkManager-gitlab-trigger-code-upstream/648/

11:28:47