Fixing authorized_keys module to make the key part detection better

Fixes #4677
Fixes #4657
Fixes #4599
Merge remote-tracking branch 'upstream/devel' into devel