check the return value of sqlite3_column_text() against NULL in get_sql_string()

The return value of sqlite3_column_text() was not checked and passed
directly to strdup() causing a SIGSEV from libc. This patch ensure that
a NULL returned value will not be given to strdup().
Merge pull request #456 from kAworu/master

check the return value of sqlite3_column_text() against NULL in get_sql_string()
Do not try to add empty option name to the struct pkg when parsing plist
Prefer testing line[0] != '\0' over calling strlen()