Catch exceptions by reference

We use polymorphic exception objects, so catching by value invokes
the copy constructor and stuff that we don't really want.
diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx
index 774f7bb..c509db0 100644
--- a/common/rfb/DecodeManager.cxx
+++ b/common/rfb/DecodeManager.cxx
@@ -277,7 +277,7 @@
       entry->decoder->decodeRect(entry->rect, entry->bufferStream->data(),
                                  entry->bufferStream->length(),
                                  *entry->cp, entry->pb);
-    } catch (rdr::Exception e) {
+    } catch (rdr::Exception& e) {
       manager->setThreadException(e);
     } catch(...) {
       assert(false);
diff --git a/common/rfb/HTTPServer.cxx b/common/rfb/HTTPServer.cxx
index 54becbb..2895a69 100644
--- a/common/rfb/HTTPServer.cxx
+++ b/common/rfb/HTTPServer.cxx
@@ -125,7 +125,7 @@
     while (1) {
       os.writeU8(is.readU8());
     }
-  } catch (rdr::EndOfStream) {
+  } catch (rdr::EndOfStream&) {
   }
 }