Mark functions as thread safe

Use attribute to mark some functions thread safe
that are falsely flagged as a problem by the static
analyzer.