The mode is about leaving the slot locked when != 0, the unlock has to be done by the code using this function.
Again, if you want to discuss about internal C code, use sr-dev@lists.kamailio.org mailing list. Do not open issues on this tracker about every piece of code you think its wrong.
If you get a deadlock or a crash because of some piece of code, then make a proper report, saying when/where it happened, with appropriate debug details as instructed in the issue template.