memoize return value of get_instance_and_attachment on request object

this lets you call it more than once without depleting the stream
Merge pull request #81 from dimagi/memoize-instance

memoize return value of get_instance_and_attachment on request object