Fixed formatting log output in signal handler.

Review: https://reviews.apache.org/r/14375
Fixed slave's finalize() method to not throw segfault.

Review: https://reviews.apache.org/r/14098