fileext: make case insensitive

Change keyword to be case insensitive when matching.

Ticket #597.
profiling: end profiling tunnel packets inside lock

End profiling inside the lock for a tunnel packet as otherwise another
thread may already free the packet while the profiling code runs.

SEGV's observed and now gone.