Fix undefined behaviors reported by UBSan
Three types of UBs are reported at https://reports.kea.isc.org/tests_status/ut-ubsan.html. I think all of them are worth fixing.
runtime error: constructor call on misaligned address * for type '*', which requires * byte alignment
runtime error: load of value *, which is not a valid value for type '*'
runtime error: member call on misaligned address * for type '*', which requires * byte alignment