portdbapi: Add cache to avoid repeated failing os.access calls