Increase test coverage of swift/common/db.py

The most low hanging fruit is _preallocate(). As it turns out,
we never excercise the calculations because we never give it
a file that exists.

This version uses mock.patch everywhere.

Change-Id: I5df03aff295d2a1bca252a02b3985a6bc3eecb26