
This patch fixes the following problems:

- Fixes a problems when setting the date with the clock_settime rtl service
  routine, the date will not get past the date of 'Sat Sep  8 19:46:39 2001'.
  If you try to set past this date the routine returns a EINVAL error.

- Fixes  the following two problems with realtime library:
    1.  A locking  problem when calling sem_close() with an invalid descriptor.
    2.  A memory leak.

