only use mutex for init on java platform, fixes #1732
Fix ignore newline by after textarea's opening tag.