base: fix NS_ERROR_XPC_BAD_CONVERT_JS on Firefox. Fixes #718