Add TSRMLS_FETCH() to replica.c