avoid undefined method `foo' for nil:NilClass when state is nil

[Sometimes node state can be `nil`](https://bugzilla.novell.com/show_bug.cgi?id=838142#c3).  We should consistently return a String (`"unknown"`) even in these cases, to ensure that code like

  node.state.titlecase

doesn't barf.