Replace first occurance of keyBuffer with a 0 to replicate iOS6

iOS6's getCString:keyBuffer:encoding truncates the string to match maxLength, it also replaces the first character with a 0 instead of keeping it intact. Replicate this behaviour so older keys used remain usable.