More av cleanup

 - Fixed consistency issues
 - Fixed bug reported by hexafl
 - Added create_recursive_mutex() 
 - Improved error indicators, now errors can indicate some internal errors too