pvclock: fix system_time() atomic-read logic

pvclock on the host ensures that when the update is complete the
version is even and when update is in progress the version is odd. It
is not enough to check if versions are equal because such sequence of
events is possible:

  Host                 Guest
  ====                 =====

              V = 0
              field1 = A1
              field2 = A2

  ++V == 1

  field1 = B1

                       V1 = V (== 1)
                       R1 = field1
                       R2 = field2
		       V2 = V (== 1 == V1)

  field2 = B2

  ++V == 2

                      R1 = B1
                      R2 = A2 (<-- wrong)

We should also check if update is in progress by checking if the
version is odd.

After fixing this, the following occasional assertion failure while
running 'make check' seems to go away:

Assertion failed: timestamp >= _last (/home/avi/osv-maint/include/osv/timer-set.hh: expire: 162)

[backtrace]
0x00000000003b54ae <sched::timer_list::fired()+1054>
0x000000000036de66 <interrupt_descriptor_table::invoke_interrupt(unsigned int)+166>
0x000000000036df59 <interrupt+41>
0x000000000036cb4c <interrupt_entry_common+34>
0x000000000038df3a <AcpiPsCreateOp+218>
0x000000000038d81d <AcpiPsParseLoop+349>
0x000000000038eb97 <AcpiPsParseAml+567>
0x00000000003762ff <AcpiDmParseDeferredOps+927>
0x0000000000376490 <AcpiDsGetRegionArguments+64>
0x0000000000388d3b <AcpiNsExecModuleCodeList+875>
0x000000000038ba50 <AcpiNsWalkNamespace+288>
0x000000000038c155 <AcpiWalkNamespace+165>
0x0000000000388ed1 <AcpiNsInitializeObjects+65>
0x00000000003989c4 <AcpiInitializeObjects+100>
0x000000000035ace5 <acpi::init()+21>
0x0000000000210346 <main_cont(int, char**)+326>
0x00000000003b7faa <thread_main_c+26>
0x000000000036cb75 <thread_main+7>
0x0000000000d19f4f <workman::_duty+2566>

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
change python scripts shebang to python2 for my environment
libc: add getgrnam_r for porting CRuby
libc: move getgrnam from runtime.cc
libc: add getpwnam_r to porting CRuby

getpwnam_r and getpwuid_r is almost same function.
So, implement getpw_r for commonly function and
To change the two function to call getpw_r
libc: add function of pgid for porting CRuby
libc: add getpgrp for porting CRuby
libc: add getppid for porting CRuby
libc: add sid function for porting CRuby
libc: add setegid for porting CRuby
libc: add seteuid for porting CRuby
libc: add setreuid for porting CRuby
libc: add setregid for porting CRuby
libc: add waitpid for porting CRuby
setting option for build and debug
libc: add pthread_attr_getguardsize() for porting CRuby
mempool: add malloc_usable_size() to C linkage for porting CRuby
README: add description about building for Arch user