Use more reliable way of converting Mono strings to null-terminated ones.