Deadlock fix adapted from https://groups.google.com/forum/#!searchin/simavr/parts%242Fuart_pty%2420not%2420threadsafe/simavr/eSVV90dFh8U/XwQmSIlrNMIJ

simduino example had deadlock issues on multi-core hosts (which I imagine is virtually all these days). Patch from mailing list did not apply cleanly so I had to apply some of it by hand.