add a method to close a slave mode in the API

Signed-off-by: Sébastien Boisvert <sebastien.boisvert.3@ulaval.ca>