memevents: Stop failure when attaching to an attached tracepoint

The current implementation of libbpf bpf_detach_tracepoint API doesn't
detach the program from the trace event[1]. This creates an issue when a
MemEventListener deregisters and registers the same event type. Due to
this we don't want to fail if the bpf program is already attached.

[1] https://github.com/iovisor/bcc/blob/7d350d90b638ddaf2c137a609b542e997597910a/src/cc/libbpf.c#L1495-L1501

Test: atest memevents_test
Bug: 244232958
Change-Id: I012f8a2c62d2c15762ccd77a65d6c4ee41b84573
Signed-off-by: Carlos Galo <carlosgalo@google.com>
2 files changed