fix return exit value, shared libs cannot use exit, but return instead

Shared libs shouldn't use "exit"

https://lintian.debian.org/tags/shlib-calls-exit.html