Fixed copy & paste error in getValue

Also added code to close the device after use to speed things up.

Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>