[node.js] fix handling null value for externalData (#24428)
### Description
<!-- Describe your changes. -->
Fix a bug when `sessionOptions.externalData === undefined` for Node.js
binding.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->