[WifiInstaller] Delete files only if parsed successfully

Added input checks and delete the configuration file (passed as
a URI) only if it contains a valid Passpoint configuration.

Bug: 176756691
Test: Download a real configuration file, verify correct
installation and file deleted.
Test: Download a garbage file with the correct mime type, verify
that installation fails and the file is not deleted.

Change-Id: Ic9106d46abd9bed642465b8d023bac6dfc5a0f3b
(cherry picked from commit 834fe82d8926a3e1ba1ce2a0811f921f006190da)
Merged-In: Ic9106d46abd9bed642465b8d023bac6dfc5a0f3b
1 file changed