openocd: add post-init and pre-shutdown helpers