Use directory-style database for bootstrapping database

This allows GHC HEAD to be bootstrapped using 7.10.

Addresses #9652

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

(cherry picked from commit 0899caab400e7a095528ea769a7e93a33717ae72)