message: Use fixed preallocation instead of costly GetSerializeSize
  Dbwrapper used GetSerializeSize() to compute the size of the buffer
  to preallocate. For some cases (specifically: CCoins) this requires
  a costly compression call. Avoid this by just using fixed size
  preallocations instead.
diff: #include <leveldb/db.h>
  #include <leveldb/write_batch.h>
  +static const size_t DBWRAPPER_PREALLOC_KEY_SIZE = 64;
  +static const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024;
  +
  class dbwrapper_error : public std::runtime_error
  {
  public:
  @@ -45,12 +48,12 @@ public:
  void Write(const K& key, const V& value)
  {
  CDataStream ssKey(SER_DISK, CLIENT_VERSION);
  - ssKey.reserve(GetSerializeSize(ssKey, key));
  + ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  ssKey << key;
  leveldb::Slice slKey(&ssKey[0], ssKey.size());
  CDataStream ssValue(SER_DISK, CLIENT_VERSION);
  - ssValue.reserve(GetSerializeSize(ssValue, value));
  + ssValue.reserve(DBWRAPPER_PREALLOC_VALUE_SIZE);
  ssValue << value;
  ssValue.Xor(*obfuscate_key);
  leveldb::Slice slValue(&ssValue[0], ssValue.size());
  @@ -62,7 +65,7 @@ public:
  void Erase(const K& key)
  {
  CDataStream ssKey(SER_DISK, CLIENT_VERSION);
  - ssKey.reserve(GetSerializeSize(ssKey, key));
  + ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  ssKey << key;
  leveldb::Slice slKey(&ssKey[0], ssKey.size());
  @@ -97,7 +100,7 @@ public:
  template<typename K> void Seek(const K& key) {
  CDataStream ssKey(SER_DISK, CLIENT_VERSION);
  - ssKey.reserve(GetSerializeSize(ssKey, key));
  + ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  ssKey << key;
  leveldb::Slice slKey(&ssKey[0], ssKey.size());
  piter->Seek(slKey);
  @@ -189,7 +192,7 @@ public:
  bool Read(const K& key, V& value) const throw(dbwrapper_error)
  {
  CDataStream ssKey(SER_DISK, CLIENT_VERSION);
  - ssKey.reserve(GetSerializeSize(ssKey, key));
  + ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  ssKey << key;
  leveldb::Slice slKey(&ssKey[0], ssKey.size());
  @@ -223,7 +226,7 @@ public:
  bool Exists(const K& key) const throw(dbwrapper_error)
  {
  CDataStream ssKey(SER_DISK, CLIENT_VERSION);
  - ssKey.reserve(GetSerializeSize(ssKey, key));
  + ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  ssKey << key;
  leveldb::Slice slKey(&ssKey[0], ssKey.size());
  