db: Extend the test to mark a SMS as delivered and verify it

Mark the SMS as delivered, then free it and try to get an
undelivered SMS to that subscriber again and make sure it
is failing.