webview js: Make `getMessageIdFromNode` more flexible.
webview js: Make `getMessageIdFromNode` more flexible.

Add a check that the node we find is an Element, avoiding a type error
on Flow 0.75.

Also add a second, optional parameter `defaultValue`.  If no node is
found, still return `-1` by default but allow returning a
user-specified value too.

vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile