libapparamor: Define a portable version of gnu basename
Since musl 1.2.5, basename(3) prototype is only provided in libgen.h (as mandated by POSIX) and not in strings.h. Also there is a major difference between the gnu basename and the one defined in libgen.h, the latter modify the argument string making them incompatible.
Fix this by defining a portable version of basename using strchr.