replayserver.cc: Use FileDescriptor object for exception safety
Write list_directory_contents in RAII style