Various fixes

- Adds COW flag
- Fixes bug where cpu mode was not restored correctly after a syscall
- Fixes some compilation warnings on dynmem