testapp: Fix race condition in opening memcached port file
testapp: Fix race condition in opening memcached port file

On WIN32 (maybe elsewhere) testapp occasionally fails to open the
memcached port file; which causes all subsequent unit tests to fail. The
issue seems to be related to the seperate access() and fopen() calls made
to detect when the file is created. Occasionally the fopen() will fail
with EPERM, even though the access() call must have succeeded.

The exact issue here is unknown, I assume on WIN32 it is possible that the
file path or similar exists before the actual file is accessible.
Regardless, simply remove the call to access() and just (repeatedly) try
to fopen() it, continuing when the call succeeds. This appears to solve
the intemittant failure on WIN32.

Change-Id: I0cb62167938843e443324fb460e6ef31cfa180b1
Reviewed-on: http://review.couchbase.org/53026
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>

couchbase/memcached,owendCB/memcached,daverigby/kv_engine,couchbase/memcached,cloudrain21/memcached-1,cloudrain21/memcached-1,owendCB/memcached,cloudrain21/memcached-1,cloudrain21/memcached-1,daverigby/kv_engine,daverigby/kv_engine,daverigby/memcached,couchbase/memcached,daverigby/kv_engine,owendCB/memcached,daverigby/memcached,daverigby/memcached,owendCB/memcached,couchbase/memcached,daverigby/memcached