[runtime] Remove the usage of pthread_cleanup_push/pop functions from io-layer code.