[PATCH v3 04/12] perf, mmap: Factor out perf_get_fd()