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 then causes it to be set to empty string.  This can cause inconsistent behavior in anything (such as a plugin) that tests the machine id.