Pios sync primitives

* fixes #1113 
* fixes #1114 
* fixes #1115 
* takes next step in abstracting os api by adding pios_mutex
No more problems with MPU9150, it is fixed with latest changes.