Set write-ahead logging once at boot

This is a rework of the previously reverted commit
6a50983169bc64f50b3747f6079df7a0a35c86b6, which was attempting to set
WAL mode after startup. It turns out that doing this can race with other
code that is trying to use the DB, resulting in DB lock errors.

Bug: 184006658
Test: CtsKeystoreTestCases
Change-Id: I737fd2750c3157a732c2677eaabf8aa114f42832
3 files changed