Fix leap year calculation

Reference: http://en.wikipedia.org/wiki/Leap_year
Bug: https://www.rtems.org/bugzilla/show_bug.cgi?id=1422