ssh: Refactor SSH key parsing
Fix several issues in the SSH Key parsing code, and directly use a
GInputStream
we can (asynchronously) read from. Take the opportunity
also to add some unit tests that we can run to make sure we're not
regressing on anything.