[clangd] Fix undefined behavior due to misaligned type cast

The current code was casting pointer to a misaligned type which is undefined behavior.
Found by compiling with Undefined Behavior Sanitizer and running tests (check-clang-tools).

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@327902 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed