Copy filename (from list) so we can free it in its entirety

basename(3) returns a non-freeable pointer and truncates the provided
string