Win32 fix for #2300.

The code doesn't use SSL and a test requires it.
[#2338] Make sure mmap can be used for writing.

1. In Win32, use explicit maximum size; in order to avoid having to stat
   and, more importantly, to be able to extend mapped file when writing,
   use the end of the explicitly requested buffer.

2. Expose the page size, to be able to write in manageable chunks.

3. Add convenience structures for writing to mapped views.

4. Finally, add p_ftruncate since mapped file is longer than necessary
   and will have to be resized.
[#2338] Allow opening filebuf for reading as well.

Since for temporary filebuf a call to mkstemp() is used, fix its Win32
version which only opened the file for writing; normally, the function
is expected to create a file for reading and writing and apply 0600 as
the permissions. See, for instance:

http://man7.org/linux/man-pages/man3/mkstemp.3.html
[#2338] Use mmap to write to indexer packfile.

Make sure to open the packfile for reading and truncate when done.