Fix issue pointed out by valgrind --leak-check=full
  - free malloc'ed block

Signed-off-by: Robin Getz <Robin.Getz@analog.com>
Add -g to the CFLAGS, for easier debugging

Signed-off-by: Robin Getz <Robin.Getz@analog.com>
Don't print things to stderr when there aren't any errors.

Signed-off-by: Robin Getz <Robin.Getz@analog.com>
Fix some whitespace damage - no functional changes
Make testing a little more robust/full featured.
Add a shell script which repeats the connect/grab/disconnect multiple
times