Improve the retry handler for file-opens.