Fix dex location filtering in dex2oat

Previously we were filtering dex location against profile keys,
this meant qualified ones like /system/.../app.apk would not match
the profile key app.apk in the profile. This CL fixes changes the
behavior to filter based on the profile key of the dex file location.

Fixed OatWriter checksum for raw data case (also found by regression
test).

Added missing FlushCloseOutputFiles to CompileImage causing DCHECK
failures for File destructor.

All the fixes are regression tested by dex2oat_test.

Test: test-art-host-gtest-dex2oat_test

Bug: 34929159
Bug: 35761072

Change-Id: I1bdc949bd644bfab1c8fea0b737a132b487a653b
6 files changed