Do not to_s the machine id if it is nil
When destroying a machine, the machine id is set to nil, the to_s causes it to be set to empty string.  This can cause inconsistent behavior in anything (such as plugins) that tests the machine id.
Merge pull request #3020 from lheinlen-os/nil_machine_id

core: do not to_s the machine id if it is nil