linuxkpi: Add strim()
This function trims whitespaces at the end of a string and returns a
pointer to the first non-whitespace character.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49374