Fix null pointer dereference in grappler::GetInputs
The bug was found by Svace static analyzer:

1. there may be zero for-loop iterations and inode stays nullptr
2. later it is zero-dereferenced by inode->name()

cc @mihaimaruseac