[Extensions] Refactoring of the XWalkExtensionFunctionHandler

Issues addressed by this branch:

- Make the ownership more clear
- Make it safe to outlive the XWalkExtensionInstance
- Thread safety of the XWalkExtensionFunctionHandler