Printing now has mutex

Printing has mutex locking functions for making it threadsafe, it has
not yet been used but that is the next goal.

Also removed an accidental .#main.cpp file emacs had put there.
Printing is now threadsafe! :D

The lineclearing and curser returning is still a bit buggy.