(A1) In a POSIX constructor function in liblzma, set an alarm(2) for a few seconds later (once sshd has fully loaded).
(A2) In the alarm callback locate the original function that was patched using dlfcn, and mmap a page of modified code over the top that calls the exploit.
Or:
(B1) POSIX constructor function, call clone(2) to start a background thread.
(B2) In the background thread, sleep for a little, then patch the code as in A2 above.
Or:
(C1) POSIX constructor function that completely replaces the sshd process with a workalike that contains the exploit.
In A & B, for OSes (not Linux) that deny mmap, you'll need to find a struct or stack frame used by the function and work out how to adjust the data it uses or find a function pointer and exploit that.