A Lightweight API for an Adaptive Software Fault Tolerance Using POSIX-Thread Replication