Add linux compatibility patches

* Reapply past patches
* See the following commits

    commit 0d378c708338e70db732f046f0b3849d4bd8146b
    Author: Kenji Rikitake <kenji.rikitake@acm.org>
    Date:   Sat May 3 10:15:02 2014 +0900

        main.c: force srandom seed cast to unsigned

    commit 290e3137e3e6ec2993099c3f865742f798156392
    Author: Kenji Rikitake <kenji.rikitake@acm.org>
    Date:   Sat May 3 10:11:40 2014 +0900

        Remove srandomdev() for Linux compatibility

        * Add `#include <time.h>` in trek.h
        * Change srandomdev() to srandom(time(NULL)) in main.c