Enable pragma foreign key for sqlite

Without this pragma, things like CASCADE won't work in sqlite.

Implements blueprint: sql-storage-driver

Change-Id: Ic24036b4b5105d1bf4e70cbf735d85a02fa2dc9a
Fix message's get and deletion

The message get was not returning the expected result. Also,
bulk_message deletion was not deleting messages due to a wrong
serialization of messages ids.

Implements blueprint: sql-storage-driver

Change-Id: I9d04dc9f615b4b1d408a710cc447cfc2ed098286