Fix crash on missing host_key

Change-Id: If5dfbfd1a931d35755eeb2a1781fad46c56a173b
Closes-Bug: #1289610