Fixed APC flush by using stream context instead of socket