exceptions: Make Tlv::Error a base class for all packet-processing exceptions

This commit also includes a number of code style fixes.

Change-Id: I44f83915e733b43d5f43b4266902c8262e928d91
Refs: #1528
diff --git a/src/security/conf/key-locator-checker.hpp b/src/security/conf/key-locator-checker.hpp
index 5785c59..e040d80 100644
--- a/src/security/conf/key-locator-checker.hpp
+++ b/src/security/conf/key-locator-checker.hpp
@@ -107,7 +107,7 @@
         failInfo = "KeyLocatorChecker failed!";
         return false;
       }
-    catch (const KeyLocator::Error& e)
+    catch (KeyLocator::Error& e)
       {
         failInfo = "KeyLocator does not have name";
         return false;
@@ -141,7 +141,7 @@
         failInfo = "KeyLocatorChecker failed!";
         return false;
       }
-    catch (const KeyLocator::Error& e)
+    catch (KeyLocator::Error& e)
       {
         failInfo = "KeyLocator does not have name";
         return false;
@@ -182,7 +182,7 @@
         failInfo = "KeyLocatorChecker failed!";
         return false;
       }
-    catch (const KeyLocator::Error& e)
+    catch (KeyLocator::Error& e)
       {
         failInfo = "KeyLocator does not have name";
         return false;
@@ -277,7 +277,7 @@
             return shared_ptr<RegexKeyLocatorNameChecker>
               (new RegexKeyLocatorNameChecker(regexString));
           }
-        catch (const Regex::Error& e)
+        catch (Regex::Error& e)
           {
             throw Error("Invalid checker.key-locator.regex: " + regexString);
           }
@@ -344,7 +344,7 @@
                                               kRegex, kExpand,
                                               relation));
           }
-        catch (const Regex::Error& e)
+        catch (Regex::Error& e)
           {
             throw Error("Invalid regex for key-locator.hyper-relation");
           }