Fix memory leak when calling endpoint method

The pending call must be unrefed in those cases
1 file changed