database: fix missing space in query

There needed to be a space after last_seen for it to be a valid query.

Signed-off-by: Jeff Mahoney <jeffm@jeffm.io>
sqlite: close connection on failure

Signed-off-by: Jeff Mahoney <jeffm@jeffm.io>
linkcache: fix timestamp handling

There were several issues with timestamp:
- It wasn't getting properly assigned to the result object
- It wasn't getting properly returned as a datetime object
- first_seen was getting mapped to the unhelpful timestamp name
- last_seen wasn't getting properly updated when the URL was pinged

Signed-off-by: Jeff Mahoney <jeffm@jeffm.io>