Improve memory usage when viewing project merge requests

Memory usage when viewing project merge requests should be both stabilized and improved. This covers everything exposed by Projects::MergeRequestsController. While we can not avoid memory allocations or growth we can make sure this only happens when intended/expected, and not due to inefficient code.

Most likely the main offender will be the Markdown reference handling code. In particular the filters pulling data from Git could lead to an increase in memory if/when blobs are loaded into memory.