Fix UAF in clearkey service's MemoryFileSystem

Fixes the potential issue of a UAF(Used After Free)
of a MemoryFileSystem handle in clearkey hidl service.
The issue can occur in a race codition where the handle
can be freed twice.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176237595#testPocBug_176237595

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-176237595_sts64

Bug: 176237595
Change-Id: I024f6716f66b21849121bef8780170014f4bf2b9
5 files changed