Avoid unnecessary data copying when emulating foreign_key_info

Use hash slices instead of temp scalars
Use the DBI hash keys when preparing results instead of sqlite's hash keys

Change-Id: Iafa80753663ddb81bde05d0286e4ac49a879905b