Install SIGTERM handler to kill typesense-server
Store spawned typesense-server PID in an AtomicI32 and install a
Unix SIGTERM/SIGINT handler that kills the child and calls _exit.
Install the handler before spawning so the PID is available. Replace
blocking wait with a poll loop (try_wait) so the signal handler can
run and terminate the child.