e-hal: shm: Use lockf() for mutual exclusion

Use advisory file locks instead of POSIX semaphores to provide mutual
exclusion. This has a few benefits:
* The only file permissions we need to worry about are those for
  /dev/epiphany.
* A process that crashes will:
  * release any locks held.
  * not leave any conflicting (file permission) lock files around for
    other processes
* We get rid of one library (pthreads) dependency.
e-hal: shm: Defer checking shm table integrity to after e_init()

Defer shm table integrity check until it is actually used.
Previously e_shm_init() would fail if the magic field did not match.
This means e_init() would also fail so the API did not provide a way
to clear the shm table.

Instead defer integrity check to when the table is accessed.
Also, make it so that the table is cleared when e_reset_system() is called.
Merge pull request #26 from adapteva/pr-shm-defer-setup-to-reset

e-shm fixes