Fix memory leak

Fixed memory leak in endpoint_mute()

TODO:
Rewrite endpoint management into Class