Fix bug with actions in menu

Trailing whitespace is interferering with the action recognition in menu.c
This change will strip all leading and trailing whitespace from dmenu results.

glib2 is already a dependency of pango/cairo, so no additional dependency is introduced.