Move master nil check above slave node check

If master is nil the "master.uuid" call in the slave node loop will be
quite unhappy.