Replace some unsafe usage of strncpy

Ensure everything is null terminated
Increase max len of chiper names

For example ECDHE-ECRSA-AES256-GCM-SHA384
Fix missing header

And just use g_snprintf() while at it..
merge from hexchat master