endCallback bug patch

If argument is not a function, then error occur when proxy.end called.

ex)
proxy.end(); //error