Applying NDB patch for issue 236

https://code.google.com/p/appengine-ndb-experiment/issues/attachmentText?id=236&aid=2360004000&name=patch.diff&token=ABZ6GAfGYzMGLx3XkvsqWO1X0Z8oY1F9ug%3A1404152047364