Fixed initialisation error

When dereferencing a hash reference in Perl XS the documentation states
that it should be casted to the required datatype. Included this to
silence initialisation error message.

Also included check to ensure that given hash references are defined as
this is also good practise.

Change-Id: Ic4bfd23f124765b72c7a52f3307a56f08ecd2af9
Fix segfault in attribute retrival

When attempting to retrieve udev attributes from a hash a crash was
happening when using 'hv_iterkey'. Switched this to use 'hv_iterkeysv'
to extract the hash key as a scalar to save having to store length
values. This resolves the segfault, but still unsure what it is about
using storing value lengths that has been causing the trouble.

Tidied up the surrounding code so that attribute retrieval works in
logicial stages now.
Return perl array ref when getting devices

Previously retrieving devices was being returned as a char array (not
sure what I was thinking at the time). Have now converted this to
actually construct and return a proper Perl array reference.

Updated test script to expect an array reference.

Change-Id: If520c0c55f792f1c37f13b93ebbf072d7a71bfc4
BUG-ID:  N/A
Created accessors for device vendor & model

Split device name accessor method into vendor and model functions and
set them to return Perl scalars. This makes the current API a work
better with Perl.

This should be updated though to reduce code duplication.

Change-Id: Ia3b12addf15c823845e01e766bd2cf4be04493d9
BUG-ID:  N/A
Converted device path retrieval to return a scalar

Accessing device path information was previously returning a char array
which Perl cannot really work with. Updated this to return a Perl scalar
so that the device path location can be retrieved correctly.

Change-Id: I5d3f553897e4850b5c0f57d8596f3af3bda58632
Added udev device property filtering

Device properties can now be provided in the search parameters when
retrieving a list of matching devices. This is provided via a hash
reference called 'property' with the search properties.

Included an example in the test script for this now too.

Also removed the hardcoded property search as filtering for properties
now works at the user level.

Change-Id: I035347b55e77e44fe7636f45b665213c2a16ba4b
BUG-ID:  N/A