Refactor DiscardableMemory for the upcoming DiscardableMemoryAllocator.

DiscardableMemory has the current limitation on Android that it's file-based
thus uses file descriptor thus is a limited resource. This will be worked
around in a future CL by adding DiscardMemoryAllocator operating on large
pieces of discardable memory (thus using less file descriptors) and allowing
the clients to operate on specific chunks.

This CL prepares this addition by refactoring the existing DiscardableMemory
implementation.
It makes it a pure interface to allow the upcoming DiscardableMemoryAllocator
to create instances of its own implementation of DiscardableMemory. This
implementation won't be backed by files, only the allocator will.

This also fixes some issues with the previous interface/implementation:                                                                                                                                                                                                                                                        
- The fact that initialization happened through an Init() method which must be
  called only once. The only benefit of this design is to allow objects to be
  constructed on the stack. In practice all the current clients are allocating
  instances in the heap anyway (although not doing so would be a simple
  change). This also made the interface hard to use correctly but easy to use 
  incorrectly. Implementation also systematically had to check that the object
  was correctly initialized.
- The fact that unlock() did an munmap() while the class was providing a
  Memory() accessor. If the client stored the pointer returned by Memory(), did 
  an Unlock(), then a Lock() (doing an mmap()) and accessed the memory through
  the previously saved pointer, he could have ended up doing uses after free.
  unmap() is not needed as part of memory unpinning AFAICT.
- Some error code paths contained resource (e.g. fd) leaks.

BUG=299828
TBR=tomhudson@chromium.org, darin@chromium.org

Review URL: https://codereview.chromium.org/24988003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229838 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 229838