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.
Merge pull request #44 from zenazn/fix-master-nil

Move master nil check above slave node check