Use HandleError() consistently to handle leveldb errors

I used this code when debugging the OSX corruption issue. It just cleans up our leveldb error-detecting code a little bit.