Fix profile magic detection.

Do not rely on the file descriptor being initialized with
offset 0. Fix a test that this change exposes as passing
wrong arguments and non-zero file offset. Clean up tests
to avoid the ResetOffset() call that's now unnecessary.

Test: m test-art-host-gtest
Bug: 148067697
Change-Id: I2a3a07712640f35766ef3b449cd02910e4438cba
2 files changed