kernel: make lwp_fork() non-static
kernel: recreate checkpointed threads

Each checkpointed thread (except the main one) is recreated using lwp_fork()
and then its state is restored by setting regs, fpregs and TLS. Finally, when
all threads are recreated they are then rescheduled.