Minor code refactoring in v4l2 plugin.
Make device inputs selectable for v4l2 plugin.

This adds an additional property to the plugin to select
an input if the device has multiple ones.
Small cleanups in v4l2 plugin.
Move some functions to separate file for v4l2 plugin.

This moves some functions that are generic to a separate source
file. While doing so the api to those functions was improved to
be more generic and not depend on knowledge about the internal
structure of the plugin.
Fix infinite loop in v4l2 plugin.

When initialization of the device fails the plugin may hang
trying to join a non-existing pthread.
Fix crash in v4l2 plugin.

This adds checks to make sure munmap and bfree are only called
when there was actually memory mapped and allocated.
Merge pull request #234 from fryshorts/v4l2-input

Make input selectable in v4l2 plugin.