Federer battles past Delbonis