Better database query error handling.

When returning due to an error, close the rows object.  Additionally,
when rows.Next returns false, check if it was caused by an error.
Merge pull request #21 from dajohi/master

Better database query error handling.