message: Fix some empty vector references
  >>> backports bitcoin/bitcoin@f478d98fe49d3c0c0f2c79b3f8d9dbfc1aafd407
  streams.h has some methods that can be tricked into dereferencing
  null pointers or end() iterators. Fix this.
diff: @@ -130,7 +130,8 @@ public:
  void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
  {
  - assert(last - first >= 0);
  + if (last == first) return;
  + assert(last - first > 0);
  if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) {
  // special case for inserting at the front when there's room
  nReadPos -= (last - first);
  @@ -142,7 +143,8 @@ public:
  #if !defined(_MSC_VER) || _MSC_VER >= 1300
  void insert(iterator it, const char* first, const char* last)
  {
  - assert(last - first >= 0);
  + if (last == first) return;
  + assert(last - first > 0);
  if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) {
  // special case for inserting at the front when there's room
  nReadPos -= (last - first);
  @@ -211,6 +213,8 @@ public:
  void read(char* pch, size_t nSize)
  {
  + if (nSize == 0) return;
  +
  // Read from the beginning of the buffer
  unsigned int nReadPosNext = nReadPos + nSize;
  if (nReadPosNext >= vch.size()) {
  