Stop using deprecated Data::{get,set}FinalBlockId()

This commit also fixes several build failures with gcc-8 and guards
against a potential crash in WriteHandle::onSegmentDataValidated()

Change-Id: I054f0f8e55f225c293e74fa219b6ee3103dd8e46
Refs: #4526
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index 5c06015..17882bb 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -44,7 +44,7 @@
   try {
     extractParameter(interest, prefix, parameter);
   }
-  catch (RepoCommandParameter::Error) {
+  catch (const RepoCommandParameter::Error&) {
     negativeReply(interest, 403);
     return;
   }