If I understand your issue, II think you should write a click handler for the add to cart link and then build the URL at click time so you can get the user edited quantity. Currently you are hard coding the URL to the quantity at the time you create the add to cart button.
So, when appending the link, give it an ID, and store the pid in data as Sheetal suggested:
$("div[data-role='content']").append('<a id="addtocart" data-pid="' + data.entity_id + '" data-role="button" data-mini="true" data-inline="true" data-icon="plus" href="#" >Add to Cart</a>').trigger('create');
Then add the handler:
$('#addtocart').on('click', function(){
var url = checkoutcart.html?pid=' + $(this).data("pid") + '&quantity=' + $("#qty").val() + '
$.mobile.changePage( url);// or location.href = url;
});
If I did not understand the issue, please create a small jsFiddle that demonstrates it...