Fix crash caused by invoke result marshalling logic calling browser API from the wrong thread