rework plugin callbacks.

init -> setup
add symmetric of setup, teardown
call setup and teardown in the container thread, before and after
the server thread.