Fix some smaller SCA issues from cppcheck

- handle return value of fuse_session_loop()
- reduce scope of some variables
- fix assigned but unused value 
- fix some reassign before use value issues
- prefer prefix ++operator for iterator