Correct a bug that occured in some cases when binding a parameter to string in a prepared statement.
The bug is described here kripken/emscripten#2374.
The correction consists in manually allocating memory for the string, and telling sqlite how to free the memory when the statement is destroyed.