Refactored file backup as a context manager.