Merge "Use patch_module in core.platform.api.stubs."