Add thread safety to linux root global functions

Also remove lock from console version, since Crt is now thread safe