[clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module.
- Refactor the structure of the code by adding a base class for all close-on-exec checks, which implements most of the needed functions.
- memfd_create() is better to set MFD_CLOEXEC flag to avoid file descriptor leakage.
Reviewers: alexfh, aaron.ballman, hokein
Reviewed By: alexfh, hokein
Subscribers: Eugene.Zelenko, chh, cfe-commits, srhines, mgorny, JDevlieghere, xazax.hun
Differential Revision: https://reviews.llvm.org/D35372